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

Unified Diff: content/browser/site_per_process_browsertest.cc

Issue 1297713004: Fix flakiness in postMessage-related SitePerProcessBrowserTests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | content/public/test/browser_test_utils.cc » ('j') | content/public/test/browser_test_utils.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/site_per_process_browsertest.cc
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc
index 72a0993ac650b43371969a814e44bbe16431bd8e..ebd71b1b1ab3ce4dbb2352f1ed6936ded68f501a 100644
--- a/content/browser/site_per_process_browsertest.cc
+++ b/content/browser/site_per_process_browsertest.cc
@@ -49,6 +49,10 @@ namespace {
void PostMessageAndWaitForReply(FrameTreeNode* sender_ftn,
const std::string& post_message_script,
const std::string& reply_status) {
+ // Subtle: msg_queue needs to be declared before the ExecuteScript below.
Charlie Reis 2015/08/14 22:54:13 ..., or else it might miss the message of interest
alexmos 2015/08/14 23:51:32 Done.
+ // See https://crbug.com/518729.
Charlie Reis 2015/08/14 22:54:13 Looks like WebUIMojoTest.ConnectToApplication migh
alexmos 2015/08/14 23:51:32 That one actually seems fine to me - it's using DO
Charlie Reis 2015/08/15 00:09:50 I'm not 100% sure, but that test doesn't do anythi
alexmos 2015/08/15 00:57:24 Ah, yes, it may be possible that the message could
+ content::DOMMessageQueue msg_queue;
nasko 2015/08/14 23:21:13 nit: no need for content:: prefix, as it is alread
alexmos 2015/08/14 23:51:32 Done. Thanks for noticing!
+
bool success = false;
EXPECT_TRUE(ExecuteScriptAndExtractBool(
sender_ftn->current_frame_host(),
@@ -56,7 +60,6 @@ void PostMessageAndWaitForReply(FrameTreeNode* sender_ftn,
&success));
EXPECT_TRUE(success);
- content::DOMMessageQueue msg_queue;
std::string status;
while (msg_queue.WaitForMessage(&status)) {
if (status == reply_status)
« no previous file with comments | « no previous file | content/public/test/browser_test_utils.cc » ('j') | content/public/test/browser_test_utils.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698