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

Unified Diff: chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc

Issue 2772983003: Prevent tests using data URLs from being broken by data URL deprecation (Closed)
Patch Set: nasko comments Created 3 years, 9 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/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
diff --git a/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc b/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
index 88022bae18aef3799cd650ece8443714e1fc77aa..76f52d880786abed83637d0f4d6edcf4597c0f54 100644
--- a/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
+++ b/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
@@ -176,7 +176,8 @@ class PopupBlockerBrowserTest : public InProcessBrowserTest {
WebContents* RunCheckTest(Browser* browser,
const std::string& test_name,
WhatToExpect what_to_expect,
- ShouldCheckTitle check_title) {
+ ShouldCheckTitle check_title,
+ const base::string16& expected_title) {
GURL url(embedded_test_server()->GetURL(test_name));
CountRenderViewHosts counter;
@@ -229,7 +230,6 @@ class PopupBlockerBrowserTest : public InProcessBrowserTest {
if (check_title == CheckTitle) {
// Check that the check passed.
- base::string16 expected_title(base::ASCIIToUTF16("PASS"));
content::TitleWatcher title_watcher(web_contents, expected_title);
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
}
@@ -237,6 +237,14 @@ class PopupBlockerBrowserTest : public InProcessBrowserTest {
return web_contents;
}
+ WebContents* RunCheckTest(Browser* browser,
+ const std::string& test_name,
+ WhatToExpect what_to_expect,
+ ShouldCheckTitle check_title) {
+ return RunCheckTest(browser, test_name, what_to_expect, check_title,
+ base::ASCIIToUTF16("PASS"));
+ }
+
private:
DISALLOW_COPY_AND_ASSIGN(PopupBlockerBrowserTest);
};
@@ -368,7 +376,8 @@ IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest,
ui_test_utils::HistoryEnumerator history(browser()->profile());
std::vector<GURL>& history_urls = history.urls();
ASSERT_EQ(2u, history_urls.size());
- ASSERT_EQ(GURL(search_string), history_urls[0]);
+ ASSERT_EQ(embedded_test_server()->GetURL("/popup_blocker/popup-success.html"),
+ history_urls[0]);
ASSERT_EQ(url, history_urls[1]);
TemplateURLService* service = TemplateURLServiceFactory::GetForProfile(
@@ -470,11 +479,8 @@ IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest, OpenerSuppressed) {
}
IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest, ShiftClick) {
- RunCheckTest(
- browser(),
- "/popup_blocker/popup-fake-click-on-anchor3.html",
- ExpectPopup,
- CheckTitle);
+ RunCheckTest(browser(), "/popup_blocker/popup-fake-click-on-anchor3.html",
+ ExpectPopup, CheckTitle, base::ASCIIToUTF16("Popup Success!"));
}
IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest, WebUI) {
« no previous file with comments | « no previous file | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698