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

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

Issue 7744039: Switch ChromeTestSuite to the same convention as ContentTestSuite: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more fixing Created 9 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 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_browser_process_test.h"
13 #include "chrome/test/base/testing_profile.h" 12 #include "chrome/test/base/testing_profile.h"
14 #include "content/browser/browser_thread.h" 13 #include "content/browser/browser_thread.h"
15 #include "content/browser/renderer_host/test_render_view_host.h" 14 #include "content/browser/renderer_host/test_render_view_host.h"
16 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
17 16
18 class GURL; 17 class GURL;
19 class NavigationController; 18 class NavigationController;
20 19
21 // Base class for browser based unit tests. BrowserWithTestWindowTest creates a 20 // Base class for browser based unit tests. BrowserWithTestWindowTest creates a
22 // Browser with a TestingProfile and TestBrowserWindow. To add a tab use 21 // Browser with a TestingProfile and TestBrowserWindow. To add a tab use
23 // AddTestingTab. For example, the following adds a tab and navigates to 22 // AddTestingTab. For example, the following adds a tab and navigates to
24 // two URLs that target the TestTabContents: 23 // two URLs that target the TestTabContents:
25 // 24 //
26 // // 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.
27 // AddTab(browser(), GURL("http://foo/1")); 26 // AddTab(browser(), GURL("http://foo/1"));
28 // NavigationController* controller = 27 // NavigationController* controller =
29 // browser()->GetTabContentsAt(0)->controller(); 28 // browser()->GetTabContentsAt(0)->controller();
30 // 29 //
31 // // Navigate somewhere else. 30 // // Navigate somewhere else.
32 // GURL url2("http://foo/2"); 31 // GURL url2("http://foo/2");
33 // NavigateAndCommit(controller, url2); 32 // NavigateAndCommit(controller, url2);
34 // 33 //
35 // // 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.
36 // browser()->OpenURL(GURL("http://foo/2"), GURL(), CURRENT_TAB, 35 // browser()->OpenURL(GURL("http://foo/2"), GURL(), CURRENT_TAB,
37 // PageTransition::TYPED); 36 // PageTransition::TYPED);
38 // CommitPendingLoadAsNewNavigation(controller, url2); 37 // CommitPendingLoadAsNewNavigation(controller, url2);
39 // 38 //
40 // Subclasses must invoke BrowserWithTestWindowTest::SetUp as it is responsible 39 // Subclasses must invoke BrowserWithTestWindowTest::SetUp as it is responsible
41 // for creating the various objects of this class. 40 // for creating the various objects of this class.
42 class BrowserWithTestWindowTest : public TestingBrowserProcessTest { 41 class BrowserWithTestWindowTest : public testing::Test {
43 public: 42 public:
44 BrowserWithTestWindowTest(); 43 BrowserWithTestWindowTest();
45 virtual ~BrowserWithTestWindowTest(); 44 virtual ~BrowserWithTestWindowTest();
46 45
47 virtual void SetUp(); 46 virtual void SetUp();
48 47
49 // Returns the current RenderViewHost for the current tab as a 48 // Returns the current RenderViewHost for the current tab as a
50 // TestRenderViewHost. 49 // TestRenderViewHost.
51 TestRenderViewHost* TestRenderViewHostForTab(TabContents* tab_contents); 50 TestRenderViewHost* TestRenderViewHostForTab(TabContents* tab_contents);
52 51
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 scoped_ptr<TestBrowserWindow> window_; 103 scoped_ptr<TestBrowserWindow> window_;
105 scoped_ptr<Browser> browser_; 104 scoped_ptr<Browser> browser_;
106 105
107 MockRenderProcessHostFactory rph_factory_; 106 MockRenderProcessHostFactory rph_factory_;
108 TestRenderViewHostFactory rvh_factory_; 107 TestRenderViewHostFactory rvh_factory_;
109 108
110 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest); 109 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest);
111 }; 110 };
112 111
113 #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