- a/Source/WebCore/ChangeLog +19 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2015-09-02  Daniel Bates  <dabates@apple.com>
2
3
        Write a test to ensure we don't regress processing of tasks when page defers loading
4
        https://bugs.webkit.org/show_bug.cgi?id=135882
5
        <rdar://problem/22550497>
6
7
        Reviewed by NOBODY (OOPS!).
8
9
        Towards adding a test for <https://bugs.webkit.org/show_bug.cgi?id=135688>, add a window.internals
10
        function, setPageDefersLoading, to enable and disable whether the page defers loading.
11
12
        Test: storage/websql/success-callback-when-page-defers-loading.html
13
14
        * testing/Internals.cpp:
15
        (WebCore::Internals::resetToConsistentState): Reset defers loading for the page to false.
16
        (WebCore::Internals::setPageDefersLoading): Added.
17
        * testing/Internals.h:
18
        * testing/Internals.idl: Added IDL declaration setPageDefersLoading.
19
1
2015-09-02  Chris Fleizach  <cfleizach@apple.com>
20
2015-09-02  Chris Fleizach  <cfleizach@apple.com>
2
21
3
        AX: WebKit does not expose max/min value of <progress> element
22
        AX: WebKit does not expose max/min value of <progress> element
- a/Source/WebCore/testing/Internals.cpp +11 lines
Lines 305-310 void Internals::resetToConsistentState(Page* page) a/Source/WebCore/testing/Internals.cpp_sec1
305
305
306
    page->setPageScaleFactor(1, IntPoint(0, 0));
306
    page->setPageScaleFactor(1, IntPoint(0, 0));
307
    page->setPagination(Pagination());
307
    page->setPagination(Pagination());
308
309
    page->setDefersLoading(false);
308
    
310
    
309
    page->mainFrame().setTextZoomFactor(1.0f);
311
    page->mainFrame().setTextZoomFactor(1.0f);
310
    
312
    
Lines 2931-2936 bool Internals::isPagePlayingAudio() a/Source/WebCore/testing/Internals.cpp_sec2
2931
    return !!(document->page()->mediaState() & MediaProducer::IsPlayingAudio);
2933
    return !!(document->page()->mediaState() & MediaProducer::IsPlayingAudio);
2932
}
2934
}
2933
2935
2936
void Internals::setPageDefersLoading(bool defersLoading)
2937
{
2938
    Document* document = contextDocument();
2939
    if (!document)
2940
        return;
2941
    if (Page* page = document->page())
2942
        page->setDefersLoading(defersLoading);
2943
}
2944
2934
RefPtr<File> Internals::createFile(const String& path)
2945
RefPtr<File> Internals::createFile(const String& path)
2935
{
2946
{
2936
    Document* document = contextDocument();
2947
    Document* document = contextDocument();
- a/Source/WebCore/testing/Internals.h +2 lines
Lines 417-422 public: a/Source/WebCore/testing/Internals.h_sec1
417
    void setPageMuted(bool);
417
    void setPageMuted(bool);
418
    bool isPagePlayingAudio();
418
    bool isPagePlayingAudio();
419
419
420
    void setPageDefersLoading(bool);
421
420
    RefPtr<File> createFile(const String&);
422
    RefPtr<File> createFile(const String&);
421
    void queueMicroTask(int);
423
    void queueMicroTask(int);
422
    bool testPreloaderSettingViewport();
424
    bool testPreloaderSettingViewport();
- a/Source/WebCore/testing/Internals.idl -1 / +3 lines
Lines 387-393 enum MediaControlEvent { a/Source/WebCore/testing/Internals.idl_sec1
387
387
388
    void setPageMuted(boolean muted);
388
    void setPageMuted(boolean muted);
389
    boolean isPagePlayingAudio();
389
    boolean isPagePlayingAudio();
390
    
390
391
    void setPageDefersLoading(boolean defersLoading);
392
391
    File createFile(DOMString url);
393
    File createFile(DOMString url);
392
    void queueMicroTask(long testNumber);
394
    void queueMicroTask(long testNumber);
393
    boolean testPreloaderSettingViewport();
395
    boolean testPreloaderSettingViewport();
- a/LayoutTests/ChangeLog +13 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2015-09-02  Daniel Bates  <dabates@apple.com>
2
3
        Write a test to ensure we don't regress processing of tasks when page defers loading
4
        https://bugs.webkit.org/show_bug.cgi?id=135882
5
        <rdar://problem/22550497>
6
7
        Reviewed by NOBODY (OOPS!).
8
9
        Add a test to ensure we do not regress <https://bugs.webkit.org/show_bug.cgi?id=135688>.
10
11
        * storage/websql/success-callback-when-page-defers-loading-expected.txt: Added.
12
        * storage/websql/success-callback-when-page-defers-loading.html: Added.
13
1
2015-09-02  Zalan Bujtas  <zalan@apple.com>
14
2015-09-02  Zalan Bujtas  <zalan@apple.com>
2
15
3
        r189233 accidentally removed some unrelated expected results.
16
        r189233 accidentally removed some unrelated expected results.
- a/LayoutTests/storage/websql/success-callback-when-page-defers-loading-expected.txt +10 lines
Line 0 a/LayoutTests/storage/websql/success-callback-when-page-defers-loading-expected.txt_sec1
1
This tests that a SQL success callback completes when the page defers loading.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS Callback invoked.
7
PASS successfullyParsed is true
8
9
TEST COMPLETE
10
- a/LayoutTests/storage/websql/success-callback-when-page-defers-loading.html +30 lines
Line 0 a/LayoutTests/storage/websql/success-callback-when-page-defers-loading.html_sec1
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="../../resources/js-test-pre.js"></script>
5
<script>
6
window.jsTestIsAsync = true;
7
8
function runTest()
9
{
10
    if (!window.testRunner || !window.internals) {
11
        testFailed("You must run this test in the test tool.");
12
        finishJSTest();
13
        return;
14
    }
15
    testRunner.clearAllDatabases();
16
    internals.setPageDefersLoading(true);
17
18
    var database = openDatabase("DatabaseTest", "1.0", "Test", 1024 /* bytes */);
19
    database.transaction(new Function(), new Function(), function () { testPassed("Callback invoked."); finishJSTest(); });
20
}
21
</script>
22
</head>
23
<body>
24
<script>
25
description("This tests that a SQL success callback completes when the page defers loading.");
26
runTest();
27
</script>
28
<script src="../../resources/js-test-post.js"></script>
29
</body>
30
</html>

Return to Bug 135882