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

Unified Diff: chrome/test/functional/ispy/client/dom.py

Issue 106523003: [I-Spy] Add support for rebaselining expectations from the web UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing dom.py Created 6 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/functional/ispy/client/dom.py
diff --git a/chrome/test/functional/ispy/client/dom.py b/chrome/test/functional/ispy/client/dom.py
new file mode 100644
index 0000000000000000000000000000000000000000..facac134e614e4a7d0f38be9ce3a730b84a93764
--- /dev/null
+++ b/chrome/test/functional/ispy/client/dom.py
@@ -0,0 +1,29 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+def GetScriptToWaitForUnchangingDOM():
+ """Gets Javascript that waits until the DOM is stable for 5 seconds.
+
+ Times out if the DOM is not stable within 30 seconds.
+
+ Returns:
+ Javascript as a string.
+ """
+ return """
+ var target = document.body;
+ var callback = arguments[arguments.length - 1]
+
+ var timeout_id = setTimeout(function() {
+ callback()
+ }, 5000);
+
+ var observer = new MutationObserver(function(mutations) {
+ clearTimeout(timeout_id);
+ timeout_id = setTimeout(function() {
+ callback();
+ }, 5000);
+ }).observe(target, {attributes: true, childList: true,
+ characterData: true, subtree: true});
+ """
« no previous file with comments | « chrome/test/functional/ispy/client/chrome_utils_unittest.py ('k') | chrome/test/functional/ispy/common/chrome_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698