Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: chrome/test/data/extensions/api_test/mutation_observers/background.js

Issue 9969178: Added browsertest to assert that extension API calls are counted as V8RecursionScopes and delay mic… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed date Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 });
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/data/extensions/api_test/mutation_observers/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698