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

Side by Side Diff: chrome/browser/ui/webui/interstitials/interstitial_ui_browsertest.cc

Issue 368143002: Add a chrome://interstitials page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bauerb comments Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/strings/utf_string_conversions.h"
6 #include "chrome/browser/chrome_notification_types.h"
7 #include "chrome/browser/devtools/devtools_window.h"
8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/tabs/tab_strip_model.h"
10 #include "chrome/test/base/in_process_browser_test.h"
11 #include "chrome/test/base/ui_test_utils.h"
12 #include "content/public/browser/devtools_manager.h"
13 #include "content/public/browser/web_contents.h"
14
15 class InterstitialUITest : public InProcessBrowserTest {
16 public:
17 InterstitialUITest() {}
18 virtual ~InterstitialUITest() {}
19
20 protected:
21 void TestInterstitial(GURL url, const std::string& page_title) {
22 ui_test_utils::NavigateToURL(browser(), url);
23 EXPECT_EQ(
24 base::ASCIIToUTF16(page_title),
25 browser()->tab_strip_model()->GetActiveWebContents()->GetTitle());
26
27 // Should also be able to open and close devtools.
28 content::RenderViewHost* rvh =
29 browser()->tab_strip_model()->GetWebContentsAt(0)->GetRenderViewHost();
30 DevToolsWindow* window = DevToolsWindow::OpenDevToolsWindowForTest(rvh,
31 true);
32 ui_test_utils::WaitUntilDevToolsWindowLoaded(window);
33 // Try closing the devtools.
34 content::WindowedNotificationObserver close_observer(
35 content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
36 content::Source<content::WebContents>(
37 window->web_contents_for_test()));
38 DevToolsWindow::ToggleDevToolsWindow(
39 browser(),
40 DevToolsToggleAction::Toggle());
41 close_observer.Wait();
42 }
43 };
44
45 IN_PROC_BROWSER_TEST_F(InterstitialUITest, OpenInterstitial) {
46 TestInterstitial(GURL("chrome://interstitials"), "Interstitials");
47 TestInterstitial(GURL("chrome://interstitials/--invalid--"), "Interstitials");
48 TestInterstitial(GURL("chrome://interstitials/ssl"), "Privacy error");
49 TestInterstitial(GURL("chrome://interstitials/safebrowsing?type=malware"),
50 "Security error");
51 TestInterstitial(GURL("chrome://interstitials/safebrowsing?type=phishing"),
52 "Security error");
53 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698