Commit 6c59363f authored by Clark DuVall's avatar Clark DuVall Committed by Commit Bot

Fix flaky DeclarativeApiTest.PersistRules with network service

Add a flush because of http://crrev.com/c/1139048.

Bug: 347159
Change-Id: Ia134666ecbf82ae99d429522178f605b009b40eb
Reviewed-on: https://chromium-review.googlesource.com/1187375Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585888}
parent bd3c0e67
...@@ -151,13 +151,10 @@ IN_PROC_BROWSER_TEST_F(DeclarativeApiTest, PRE_PersistRules) { ...@@ -151,13 +151,10 @@ IN_PROC_BROWSER_TEST_F(DeclarativeApiTest, PRE_PersistRules) {
ASSERT_TRUE(RunExtensionTest("declarative/redirect_to_data")) << message_; ASSERT_TRUE(RunExtensionTest("declarative/redirect_to_data")) << message_;
} }
// Disabled on Linux for flakiness: https://crbug.com/347159 IN_PROC_BROWSER_TEST_F(DeclarativeApiTest, PersistRules) {
#if defined(OS_LINUX) // Wait for declarative rules to be set up from PRE test.
#define MAYBE_PersistRules DISABLED_PersistRules content::BrowserContext::GetDefaultStoragePartition(profile())
#else ->FlushNetworkInterfaceForTesting();
#define MAYBE_PersistRules PersistRules
#endif
IN_PROC_BROWSER_TEST_F(DeclarativeApiTest, MAYBE_PersistRules) {
ui_test_utils::NavigateToURL(browser(), GURL(kArbitraryUrl)); ui_test_utils::NavigateToURL(browser(), GURL(kArbitraryUrl));
EXPECT_EQ(kTestTitle, GetTitle()); EXPECT_EQ(kTestTitle, GetTitle());
} }
......
...@@ -28,10 +28,6 @@ function report(details) { ...@@ -28,10 +28,6 @@ function report(details) {
} }
} }
chrome.runtime.onInstalled.addListener(function(details) {
chrome.declarativeWebRequest.onRequest.addRules([rule], report);
});
var activeTabId; var activeTabId;
function navigateAndWait(url, callback) { function navigateAndWait(url, callback) {
...@@ -60,7 +56,11 @@ chrome.test.runTests([ ...@@ -60,7 +56,11 @@ chrome.test.runTests([
})) }))
}, },
function checkTitle() { function checkTitle() {
navigateAndWait('http://www.example.com', chrome.declarativeWebRequest.onRequest.addRules([rule],
chrome.test.callbackPass(checkTitleCallback)); chrome.test.callbackPass(function(details) {
report(details);
navigateAndWait('http://www.example.com',
chrome.test.callbackPass(checkTitleCallback));
}));
} }
]); ]);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment