Title: [189568] trunk
- Revision
- 189568
- Author
- [email protected]
- Date
- 2015-09-10 08:50:58 -0700 (Thu, 10 Sep 2015)
Log Message
Write a test to ensure we don't regress processing of tasks when page defers loading
https://bugs.webkit.org/show_bug.cgi?id=135882
<rdar://problem/22550497>
Reviewed by Darin Adler.
Source/WebCore:
Towards adding a test for <https://bugs.webkit.org/show_bug.cgi?id=135688>, add a window.internals
function, setPageDefersLoading, to enable and disable whether the page defers loading.
Test: storage/websql/success-callback-when-page-defers-loading.html
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState): Reset defers loading for the page to false.
(WebCore::Internals::setPageDefersLoading): Added.
* testing/Internals.h:
* testing/Internals.idl: Added IDL declaration setPageDefersLoading.
LayoutTests:
Add a test to ensure we do not regress <https://bugs.webkit.org/show_bug.cgi?id=135688>.
* storage/websql/success-callback-when-page-defers-loading-expected.txt: Added.
* storage/websql/success-callback-when-page-defers-loading.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (189567 => 189568)
--- trunk/LayoutTests/ChangeLog 2015-09-10 11:58:24 UTC (rev 189567)
+++ trunk/LayoutTests/ChangeLog 2015-09-10 15:50:58 UTC (rev 189568)
@@ -1,3 +1,16 @@
+2015-09-10 Daniel Bates <[email protected]>
+
+ Write a test to ensure we don't regress processing of tasks when page defers loading
+ https://bugs.webkit.org/show_bug.cgi?id=135882
+ <rdar://problem/22550497>
+
+ Reviewed by Darin Adler.
+
+ Add a test to ensure we do not regress <https://bugs.webkit.org/show_bug.cgi?id=135688>.
+
+ * storage/websql/success-callback-when-page-defers-loading-expected.txt: Added.
+ * storage/websql/success-callback-when-page-defers-loading.html: Added.
+
2015-09-10 Sergio Villar Senin <[email protected]>
min-width/height should default to auto for flexbox items
Added: trunk/LayoutTests/storage/websql/success-callback-when-page-defers-loading-expected.txt (0 => 189568)
--- trunk/LayoutTests/storage/websql/success-callback-when-page-defers-loading-expected.txt (rev 0)
+++ trunk/LayoutTests/storage/websql/success-callback-when-page-defers-loading-expected.txt 2015-09-10 15:50:58 UTC (rev 189568)
@@ -0,0 +1,10 @@
+This tests that a SQL success callback completes when the page defers loading.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Callback invoked.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/storage/websql/success-callback-when-page-defers-loading.html (0 => 189568)
--- trunk/LayoutTests/storage/websql/success-callback-when-page-defers-loading.html (rev 0)
+++ trunk/LayoutTests/storage/websql/success-callback-when-page-defers-loading.html 2015-09-10 15:50:58 UTC (rev 189568)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script>
+window.jsTestIsAsync = true;
+
+function runTest()
+{
+ if (!window.testRunner || !window.internals) {
+ testFailed("You must run this test in the test tool.");
+ finishJSTest();
+ return;
+ }
+ testRunner.clearAllDatabases();
+ internals.setPageDefersLoading(true);
+
+ var database = openDatabase("DatabaseTest", "1.0", "Test", 1024 /* bytes */);
+ database.transaction(new Function(), new Function(), function () { testPassed("Callback invoked."); finishJSTest(); });
+}
+</script>
+</head>
+<body>
+<script>
+description("This tests that a SQL success callback completes when the page defers loading.");
+runTest();
+</script>
+<script src=""
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (189567 => 189568)
--- trunk/Source/WebCore/ChangeLog 2015-09-10 11:58:24 UTC (rev 189567)
+++ trunk/Source/WebCore/ChangeLog 2015-09-10 15:50:58 UTC (rev 189568)
@@ -1,3 +1,22 @@
+2015-09-10 Daniel Bates <[email protected]>
+
+ Write a test to ensure we don't regress processing of tasks when page defers loading
+ https://bugs.webkit.org/show_bug.cgi?id=135882
+ <rdar://problem/22550497>
+
+ Reviewed by Darin Adler.
+
+ Towards adding a test for <https://bugs.webkit.org/show_bug.cgi?id=135688>, add a window.internals
+ function, setPageDefersLoading, to enable and disable whether the page defers loading.
+
+ Test: storage/websql/success-callback-when-page-defers-loading.html
+
+ * testing/Internals.cpp:
+ (WebCore::Internals::resetToConsistentState): Reset defers loading for the page to false.
+ (WebCore::Internals::setPageDefersLoading): Added.
+ * testing/Internals.h:
+ * testing/Internals.idl: Added IDL declaration setPageDefersLoading.
+
2015-09-10 Sergio Villar Senin <[email protected]>
min-width/height should default to auto for flexbox items
Modified: trunk/Source/WebCore/testing/Internals.cpp (189567 => 189568)
--- trunk/Source/WebCore/testing/Internals.cpp 2015-09-10 11:58:24 UTC (rev 189567)
+++ trunk/Source/WebCore/testing/Internals.cpp 2015-09-10 15:50:58 UTC (rev 189568)
@@ -305,6 +305,8 @@
page->setPageScaleFactor(1, IntPoint(0, 0));
page->setPagination(Pagination());
+
+ page->setDefersLoading(false);
page->mainFrame().setTextZoomFactor(1.0f);
@@ -2935,6 +2937,15 @@
return !!(document->page()->mediaState() & MediaProducer::IsPlayingAudio);
}
+void Internals::setPageDefersLoading(bool defersLoading)
+{
+ Document* document = contextDocument();
+ if (!document)
+ return;
+ if (Page* page = document->page())
+ page->setDefersLoading(defersLoading);
+}
+
RefPtr<File> Internals::createFile(const String& path)
{
Document* document = contextDocument();
Modified: trunk/Source/WebCore/testing/Internals.h (189567 => 189568)
--- trunk/Source/WebCore/testing/Internals.h 2015-09-10 11:58:24 UTC (rev 189567)
+++ trunk/Source/WebCore/testing/Internals.h 2015-09-10 15:50:58 UTC (rev 189568)
@@ -418,6 +418,8 @@
void setPageMuted(bool);
bool isPagePlayingAudio();
+ void setPageDefersLoading(bool);
+
RefPtr<File> createFile(const String&);
void queueMicroTask(int);
bool testPreloaderSettingViewport();
Modified: trunk/Source/WebCore/testing/Internals.idl (189567 => 189568)
--- trunk/Source/WebCore/testing/Internals.idl 2015-09-10 11:58:24 UTC (rev 189567)
+++ trunk/Source/WebCore/testing/Internals.idl 2015-09-10 15:50:58 UTC (rev 189568)
@@ -387,7 +387,9 @@
void setPageMuted(boolean muted);
boolean isPagePlayingAudio();
-
+
+ void setPageDefersLoading(boolean defersLoading);
+
File createFile(DOMString url);
void queueMicroTask(long testNumber);
boolean testPreloaderSettingViewport();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes