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

Unified Diff: chrome/test/data/extensions/api_test/automation/tests/tabs/close_tab.js

Issue 1308813008: Fix crash when accessing automation node from stale AX tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Put setTimeout in else to be more clear Created 5 years, 4 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
« no previous file with comments | « chrome/renderer/resources/extensions/automation/automation_node.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/automation/tests/tabs/close_tab.js
diff --git a/chrome/test/data/extensions/api_test/automation/tests/tabs/close_tab.js b/chrome/test/data/extensions/api_test/automation/tests/tabs/close_tab.js
index bb2d619b8c05af6f8118e08ed3851d905a2d596a..aa04332d65849bcbf2d4987c0051b79023505278 100644
--- a/chrome/test/data/extensions/api_test/automation/tests/tabs/close_tab.js
+++ b/chrome/test/data/extensions/api_test/automation/tests/tabs/close_tab.js
@@ -8,10 +8,15 @@ var allTests = [
chrome.tabs.create({'url': url}, function(tab) {
chrome.automation.getTree(function(rootNode) {
rootNode.addEventListener(EventType.destroyed, function() {
- // Should get a 'destroyed' event when the tab is closed.
- // TODO(aboxhall): assert actual cleanup has occurred once
- // crbug.com/387954 makes it possible.
- chrome.test.succeed();
+ // Poll until the root node doesn't have a role anymore
David Tseng 2015/08/28 22:51:25 Do we get an event (as to avoid busy waiting?).
dmazzoni 2015/08/28 23:02:35 We get the event immediately before it's destroyed
+ // indicating that it really did get cleaned up.
+ function checkSuccess() {
+ if (rootNode.role === undefined)
+ chrome.test.succeed();
+ else
+ window.setTimeout(checkSuccess, 10);
+ }
+ checkSuccess();
});
chrome.tabs.remove(tab.id);
});
« no previous file with comments | « chrome/renderer/resources/extensions/automation/automation_node.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698