Changeset 107306 in webkit


Ignore:
Timestamp:
Feb 9, 2012 4:35:43 PM (12 years ago)
Author:
adamk@chromium.org
Message:

Split one MutationObserver layout test into two
https://bugs.webkit.org/show_bug.cgi?id=78285

Reviewed by Ojan Vafai.

Rather than a single non-event-delivery.html test,
created seperate tests for SQL database and FileSystem,
making it easy to skip them separately if the underlying
feature isn't supported by a particular platform.

  • fast/mutation/database-callback-delivery-expected.txt: Added.
  • fast/mutation/database-callback-delivery.html: Added.
  • fast/mutation/filesystem-callback-delivery-expected.txt: Added.
  • fast/mutation/filesystem-callback-delivery.html: Added.
  • fast/mutation/non-event-delivery-expected.txt: Removed.
  • fast/mutation/non-event-delivery.html: Removed.
Location:
trunk/LayoutTests
Files:
2 added
1 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r107301 r107306  
     12012-02-09  Adam Klein  <adamk@chromium.org>
     2
     3        Split one MutationObserver layout test into two
     4        https://bugs.webkit.org/show_bug.cgi?id=78285
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Rather than a single non-event-delivery.html test,
     9        created seperate tests for SQL database and FileSystem,
     10        making it easy to skip them separately if the underlying
     11        feature isn't supported by a particular platform.
     12
     13        * fast/mutation/database-callback-delivery-expected.txt: Added.
     14        * fast/mutation/database-callback-delivery.html: Added.
     15        * fast/mutation/filesystem-callback-delivery-expected.txt: Added.
     16        * fast/mutation/filesystem-callback-delivery.html: Added.
     17        * fast/mutation/non-event-delivery-expected.txt: Removed.
     18        * fast/mutation/non-event-delivery.html: Removed.
     19
    1202012-02-09  Matthew Delaney  <mdelaney@apple.com>
    221
  • trunk/LayoutTests/fast/mutation/filesystem-callback-delivery-expected.txt

    • Property svn:eol-style set to LF
    r107304 r107306  
    1 Test that Mutation Records are delivered following non-event async callbacks.
     1Test that Mutation Records are delivered following FileSystem callbacks.
    22
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
    44
    55
    6 Testing mutations are delivered following Database transaction callbacks.
    7 PASS mutations.length is 1
    8 PASS mutations[0].type is "attributes"
    9 PASS mutations[0].attributeName is "foo"
    10 
    11 Testing mutations are delivered following Filesystem callbacks.
    126PASS mutations.length is 1
    137PASS mutations[0].type is "attributes"
  • trunk/LayoutTests/fast/mutation/filesystem-callback-delivery.html

    • Property svn:eol-style set to LF
    r107304 r107306  
    11<!DOCTYPE html>
    2 <html>
    3 <head>
    4 <meta charset="utf-8">
    52<script src="../js/resources/js-test-pre.js"></script>
    6 </head>
    7 <body>
    8 <p id=description></p>
    9 <div id="console"></div>
    103<script>
    11 
    124window.jsTestIsAsync = true;
    135var mutations;
    14 
    15 function testDatabase() {
    16     var div;
    17     var db;
    18     var observer;
    19 
    20     function start() {
    21         debug('Testing mutations are delivered following Database transaction callbacks.');
    22 
    23         mutations = null;
    24         div = document.createElement('div');
    25         observer = new WebKitMutationObserver(function(m) {
    26             mutations = m;
    27         });
    28 
    29         observer.observe(div, { attributes: true, characterData: true });
    30 
    31         db = openDatabase('DatabaseMutationDelivery', '1.0', '', 1);
    32         db.transaction(mutate);
    33     }
    34 
    35     function mutate() {
    36         div.setAttribute('foo', 'bar');
    37         setTimeout(finish, 0);
    38     }
    39 
    40     function finish() {
    41         shouldBe('mutations.length', '1');
    42         shouldBe('mutations[0].type', '"attributes"');
    43         shouldBe('mutations[0].attributeName', '"foo"');
    44         observer.disconnect();
    45         debug('');
    46         runNextTest();
    47     }
    48 
    49     start();
    50 }
    516
    527function testFilesystem() {
     
    5611
    5712    function start() {
    58         debug('Testing mutations are delivered following Filesystem callbacks.');
    59 
    6013        mutations = null;
    6114        div = document.createElement('div');
     
    9649        observer.disconnect();
    9750        debug('');
    98         runNextTest();
     51        finishJSTest();
    9952    }
    10053
     
    10255}
    10356
    104 var tests = [
    105     testDatabase,
    106     testFilesystem
    107 ];
    108 var testIndex = 0;
     57description('Test that Mutation Records are delivered following FileSystem callbacks.');
    10958
    110 function runNextTest() {
    111     if (testIndex < tests.length)
    112         tests[testIndex++]();
    113     else
    114         finishJSTest();
    115 }
    116 
    117 description('Test that Mutation Records are delivered following non-event async callbacks.');
    118 
    119 if (!window.WebKitMutationObserver) {
    120     testFailed('This test requires ENABLE(MUTATION_OBSERVERS)');
    121     finishJSTest();
    122 } else if (!window.webkitRequestFileSystem) {
    123     testFailed('This test requires ENABLE(FILE_SYSTEM)');
     59if (!window.WebKitMutationObserver || !window.webkitRequestFileSystem) {
     60    testFailed('This test requires ENABLE(MUTATION_OBSERVERS) and ENABLE(FILE_SYSTEM)');
    12461    finishJSTest();
    12562} else
    126     runNextTest();
    127 
     63    testFilesystem();
    12864</script>
    12965<script src="../js/resources/js-test-post.js"></script>
    130 </body>
    131 </html>
Note: See TracChangeset for help on using the changeset viewer.