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

Side by Side Diff: content/browser/browser_side_navigation_browsertest.cc

Issue 1411073005: Migrating tests to use EmbeddedTestServer (/content) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "content/browser/web_contents/web_contents_impl.h" 8 #include "content/browser/web_contents/web_contents_impl.h"
9 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
10 #include "content/public/common/content_switches.h" 10 #include "content/public/common/content_switches.h"
(...skipping 13 matching lines...) Expand all
24 public: 24 public:
25 BrowserSideNavigationBrowserTest() {} 25 BrowserSideNavigationBrowserTest() {}
26 26
27 protected: 27 protected:
28 void SetUpCommandLine(base::CommandLine* command_line) override { 28 void SetUpCommandLine(base::CommandLine* command_line) override {
29 command_line->AppendSwitch(switches::kEnableBrowserSideNavigation); 29 command_line->AppendSwitch(switches::kEnableBrowserSideNavigation);
30 } 30 }
31 31
32 void SetUpOnMainThread() override { 32 void SetUpOnMainThread() override {
33 host_resolver()->AddRule("*", "127.0.0.1"); 33 host_resolver()->AddRule("*", "127.0.0.1");
34 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 34 ASSERT_TRUE(embedded_test_server()->Start());
35 } 35 }
36 }; 36 };
37 37
38 // Ensure that browser initiated basic navigations work with browser side 38 // Ensure that browser initiated basic navigations work with browser side
39 // navigation. 39 // navigation.
40 IN_PROC_BROWSER_TEST_F(BrowserSideNavigationBrowserTest, 40 IN_PROC_BROWSER_TEST_F(BrowserSideNavigationBrowserTest,
41 BrowserInitiatedNavigations) { 41 BrowserInitiatedNavigations) {
42 // Perform a navigation with no live renderer. 42 // Perform a navigation with no live renderer.
43 { 43 {
44 TestNavigationObserver observer(shell()->web_contents()); 44 TestNavigationObserver observer(shell()->web_contents());
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 base::Bind(&net::URLRequestFailedJob::AddUrlHandler)); 181 base::Bind(&net::URLRequestFailedJob::AddUrlHandler));
182 NavigateToURL(shell(), error_url); 182 NavigateToURL(shell(), error_url);
183 EXPECT_EQ(error_url, observer.last_navigation_url()); 183 EXPECT_EQ(error_url, observer.last_navigation_url());
184 NavigationEntry* entry = 184 NavigationEntry* entry =
185 shell()->web_contents()->GetController().GetLastCommittedEntry(); 185 shell()->web_contents()->GetController().GetLastCommittedEntry();
186 EXPECT_EQ(PAGE_TYPE_ERROR, entry->GetPageType()); 186 EXPECT_EQ(PAGE_TYPE_ERROR, entry->GetPageType());
187 } 187 }
188 } 188 }
189 189
190 } // namespace content 190 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/background_sync/background_sync_browsertest.cc ('k') | content/browser/cross_site_transfer_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698