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

Unified Diff: chrome/test/data/extensions/platform_apps/web_view/shim/main.js

Issue 310963002: Fix a possible race in WebViewTest.Shim_TestPartitionRaisesException. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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/browser/apps/web_view_browsertest.cc ('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/platform_apps/web_view/shim/main.js
diff --git a/chrome/test/data/extensions/platform_apps/web_view/shim/main.js b/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
index fdc08a68871fa997184ba67d2074aaa8828a1de7..64102f698445a6fd2e0d4e41420579ea365e88b8 100644
--- a/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
+++ b/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
@@ -580,16 +580,19 @@ function testCannotMutateEventName() {
function testPartitionRaisesException() {
var webview = document.createElement('webview');
webview.setAttribute('partition', arguments.callee.name);
- webview.setAttribute('src', 'data:text/html,trigger navigation');
- document.body.appendChild(webview);
- setTimeout(function() {
+
+ var loadstopHandler = function(e) {
try {
webview.partition = 'illegal';
embedder.test.fail();
} catch (e) {
embedder.test.succeed();
}
- }, 0);
+ };
+ webview.addEventListener('loadstop', loadstopHandler);
+
+ document.body.appendChild(webview);
+ webview.setAttribute('src', 'data:text/html,trigger navigation');
}
function testExecuteScriptFail() {
« no previous file with comments | « chrome/browser/apps/web_view_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698