| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 window.addEventListener('DOMContentLoaded', function() { |
| 6 var body = document.body; |
| 7 var div = body.appendChild(document.createElement('div')); |
| 8 var input1 = body.appendChild(document.createElement('input')); |
| 9 var input2 = body.appendChild(document.createElement('input')); |
| 10 |
| 11 input1.focus(); |
| 12 input1.addEventListener('blur', function() { |
| 13 div.setAttribute('baz', 'bat'); |
| 14 }); |
| 15 |
| 16 var success = false; |
| 17 var mutationsDelivered = false; |
| 18 |
| 19 var MutationObserver = MutationObserver || WebKitMutationObserver; |
| 20 var observer = new MutationObserver(function() { |
| 21 mutationsDelivered = true; |
| 22 if (success) |
| 23 chrome.test.succeed(); |
| 24 }); |
| 25 observer.observe(document, { subtree: true, attributes: true }); |
| 26 |
| 27 // The getAll callback should be counted as a V8RecursionScope and cause |
| 28 // the delivery of MutationRecords to be delayed until it has exited. |
| 29 chrome.windows.getAll(function() { |
| 30 div.setAttribute('foo', 'bar'); |
| 31 input2.focus(); |
| 32 if (mutationsDelivered) |
| 33 chrome.test.fail(); |
| 34 else |
| 35 success = true; |
| 36 }); |
| 37 }); |
| OLD | NEW |