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

Unified Diff: chrome/browser/policy/policy_browsertest.cc

Issue 520703002: Fixed flakyness of PolicyTest.FileURLBlacklist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove DrMemory exclude Created 6 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 | tools/valgrind/gtest_exclude/browser_tests.gtest-drmemory.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/policy_browsertest.cc
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index c68741703129f3b275dcf2c5fc555f7e172f627d..ed0206ba6ea32158090e78d841e1a8ee73c76331 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -23,6 +23,7 @@
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/test_file_util.h"
+#include "base/threading/sequenced_worker_pool.h"
#include "base/time/time.h"
#include "base/values.h"
#include "chrome/app/chrome_command_ids.h"
@@ -293,7 +294,9 @@ void CheckCanOpenURL(Browser* browser, const char* spec) {
content::WebContents* contents =
browser->tab_strip_model()->GetActiveWebContents();
EXPECT_EQ(url, contents->GetURL());
- base::string16 title = base::UTF8ToUTF16(url.spec() + " was blocked");
+ base::string16 spec16 = base::UTF8ToUTF16(url.spec());
+ base::string16 title =
+ l10n_util::GetStringFUTF16(IDS_ERRORPAGES_TITLE_BLOCKED, spec16);
EXPECT_NE(title, contents->GetTitle());
}
@@ -304,7 +307,9 @@ void CheckURLIsBlocked(Browser* browser, const char* spec) {
content::WebContents* contents =
browser->tab_strip_model()->GetActiveWebContents();
EXPECT_EQ(url, contents->GetURL());
- base::string16 title = base::UTF8ToUTF16(url.spec() + " was blocked");
+ base::string16 spec16 = base::UTF8ToUTF16(url.spec());
+ base::string16 title =
+ l10n_util::GetStringFUTF16(IDS_ERRORPAGES_TITLE_BLOCKED, spec16);
EXPECT_EQ(title, contents->GetTitle());
// Verify that the expected error page is being displayed.
@@ -452,9 +457,9 @@ int CountPlugins() {
void FlushBlacklistPolicy() {
// Updates of the URLBlacklist are done on IO, after building the blacklist
- // on FILE, which is initiated from IO.
+ // on the blocking pool, which is initiated from IO.
content::RunAllPendingInMessageLoop(BrowserThread::IO);
- content::RunAllPendingInMessageLoop(BrowserThread::FILE);
+ BrowserThread::GetBlockingPool()->FlushForTesting();
content::RunAllPendingInMessageLoop(BrowserThread::IO);
}
« no previous file with comments | « no previous file | tools/valgrind/gtest_exclude/browser_tests.gtest-drmemory.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698