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

Unified Diff: chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc

Issue 1222193006: Remove race in DeclarativeContentApiTest.RulesPersistence test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | chrome/test/data/extensions/api_test/declarative_content/persistence/background.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc
diff --git a/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc b/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc
index f21802c626adc8c2804b2c9315ba2ed1f56e75ab..6407a9a1f7a5cfa3dbc03dabbc648ca3849ecb13 100644
--- a/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc
+++ b/chrome/browser/extensions/api/declarative_content/declarative_content_apitest.cc
@@ -485,15 +485,17 @@ IN_PROC_BROWSER_TEST_F(DeclarativeContentApiTest, PRE_RulesPersistence) {
// Reloads the extension from PRE_RulesPersistence and checks that the rules
// continue to work as expected after being persisted and reloaded.
IN_PROC_BROWSER_TEST_F(DeclarativeContentApiTest, RulesPersistence) {
- ExtensionTestMessageListener ready("second run ready", false);
- ExtensionTestMessageListener ready_split("second run ready (split)", false);
- ASSERT_TRUE(ready.WaitUntilSatisfied());
-
ExtensionRegistry* registry = ExtensionRegistry::Get(profile());
+ const base::FilePath path = test_data_dir_.
+ AppendASCII("declarative_content").AppendASCII("persistence");
const Extension* extension =
- GetExtensionByPath(registry->enabled_extensions(),
- test_data_dir_.AppendASCII("declarative_content")
- .AppendASCII("persistence"));
+ GetExtensionByPath(registry->enabled_extensions(), path);
+
+ if (!extension) {
+ ExtensionTestMessageListener ready("second run ready", false);
+ ASSERT_TRUE(ready.WaitUntilSatisfied());
+ extension = GetExtensionByPath(registry->enabled_extensions(), path);
+ }
// Check non-incognito browser.
content::WebContents* const tab =
@@ -513,6 +515,7 @@ IN_PROC_BROWSER_TEST_F(DeclarativeContentApiTest, RulesPersistence) {
EXPECT_FALSE(page_action->GetIsVisible(tab_id));
// Check incognito browser.
+ ExtensionTestMessageListener ready_split("second run ready (split)", false);
Browser* incognito_browser = CreateIncognitoBrowser();
ASSERT_TRUE(ready_split.WaitUntilSatisfied());
content::WebContents* const incognito_tab =
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/declarative_content/persistence/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698