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

Side by Side Diff: chrome/test/base/browser_with_test_window_test.h

Issue 8224023: Don't show URL for pending new navigations initiated by the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add IsBrowserInitiated helper. Created 9 years, 2 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_ 5 #ifndef CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_
6 #define CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_ 6 #define CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/test/base/test_browser_window.h" 11 #include "chrome/test/base/test_browser_window.h"
12 #include "chrome/test/base/testing_profile.h" 12 #include "chrome/test/base/testing_profile.h"
13 #include "content/browser/browser_thread.h" 13 #include "content/browser/browser_thread.h"
14 #include "content/browser/renderer_host/test_render_view_host.h" 14 #include "content/browser/renderer_host/test_render_view_host.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 class GURL; 17 class GURL;
18 class NavigationController; 18 class NavigationController;
19 19
20 // Base class for browser based unit tests. BrowserWithTestWindowTest creates a 20 // Base class for browser based unit tests. BrowserWithTestWindowTest creates a
21 // Browser with a TestingProfile and TestBrowserWindow. To add a tab use 21 // Browser with a TestingProfile and TestBrowserWindow. To add a tab use
22 // AddTestingTab. For example, the following adds a tab and navigates to 22 // AddTab. For example, the following adds a tab and navigates to
23 // two URLs that target the TestTabContents: 23 // two URLs that target the TestTabContents:
24 // 24 //
25 // // Add a new tab and navigate it. This will be at index 0. 25 // // Add a new tab and navigate it. This will be at index 0.
26 // AddTab(browser(), GURL("http://foo/1")); 26 // AddTab(browser(), GURL("http://foo/1"));
27 // NavigationController* controller = 27 // NavigationController* controller =
28 // browser()->GetTabContentsAt(0)->controller(); 28 // &browser()->GetTabContentsAt(0)->controller();
29 // 29 //
30 // // Navigate somewhere else. 30 // // Navigate somewhere else.
31 // GURL url2("http://foo/2"); 31 // GURL url2("http://foo/2");
32 // NavigateAndCommit(controller, url2); 32 // NavigateAndCommit(controller, url2);
33 // 33 //
34 // // This is equivalent to the above, and lets you test pending navigations. 34 // // This is equivalent to the above, and lets you test pending navigations.
35 // browser()->OpenURL(GURL("http://foo/2"), GURL(), CURRENT_TAB, 35 // browser()->OpenURL(GURL("http://foo/2"), GURL(), CURRENT_TAB,
36 // PageTransition::TYPED); 36 // PageTransition::TYPED);
37 // CommitPendingLoadAsNewNavigation(controller, url2); 37 // CommitPendingLoad(controller);
38 // 38 //
39 // Subclasses must invoke BrowserWithTestWindowTest::SetUp as it is responsible 39 // Subclasses must invoke BrowserWithTestWindowTest::SetUp as it is responsible
40 // for creating the various objects of this class. 40 // for creating the various objects of this class.
41 class BrowserWithTestWindowTest : public testing::Test { 41 class BrowserWithTestWindowTest : public testing::Test {
42 public: 42 public:
43 BrowserWithTestWindowTest(); 43 BrowserWithTestWindowTest();
44 virtual ~BrowserWithTestWindowTest(); 44 virtual ~BrowserWithTestWindowTest();
45 45
46 virtual void SetUp(); 46 virtual void SetUp();
47 47
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 scoped_ptr<TestBrowserWindow> window_; 103 scoped_ptr<TestBrowserWindow> window_;
104 scoped_ptr<Browser> browser_; 104 scoped_ptr<Browser> browser_;
105 105
106 MockRenderProcessHostFactory rph_factory_; 106 MockRenderProcessHostFactory rph_factory_;
107 TestRenderViewHostFactory rvh_factory_; 107 TestRenderViewHostFactory rvh_factory_;
108 108
109 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest); 109 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest);
110 }; 110 };
111 111
112 #endif // CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_ 112 #endif // CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698