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

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: Charlie's comments (and rebase) 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') | no next file with comments »
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 9cbeceb5047d4105d7015c54fbbeb495c5ffb3b7..2464a38788240ea86f6b1f6e9eb5258585c5d03a 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, or
+ // else it might miss the message of interest. See https://crbug.com/518729.
+ DOMMessageQueue msg_queue;
+
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)
@@ -2479,16 +2482,8 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, SubframePostMessage) {
// Check that postMessage can be sent from a subframe on a cross-process opener
// tab, and that its event.source points to a valid proxy.
-// Very flaky on windows (crbug.com/518729).
-#if defined(OS_WIN)
-#define MAYBE_PostMessageWithSubframeOnOpenerChain \
- DISABLED_PostMessageWithSubframeOnOpenerChain
-#else
-#define MAYBE_PostMessageWithSubframeOnOpenerChain \
- PostMessageWithSubframeOnOpenerChain
-#endif // defined(OS_WIN)
IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
- MAYBE_PostMessageWithSubframeOnOpenerChain) {
+ PostMessageWithSubframeOnOpenerChain) {
GURL main_url(embedded_test_server()->GetURL(
"a.com", "/frame_tree/page_with_post_message_frames.html"));
EXPECT_TRUE(NavigateToURL(shell(), main_url));
« no previous file with comments | « no previous file | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698