OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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" |
(...skipping 23 matching lines...) Expand all Loading... |
34 } | 34 } |
35 | 35 |
36 // Base class for browser based unit tests. BrowserWithTestWindowTest creates a | 36 // Base class for browser based unit tests. BrowserWithTestWindowTest creates a |
37 // Browser with a TestingProfile and TestBrowserWindow. To add a tab use | 37 // Browser with a TestingProfile and TestBrowserWindow. To add a tab use |
38 // AddTab. For example, the following adds a tab and navigates to | 38 // AddTab. For example, the following adds a tab and navigates to |
39 // two URLs that target the TestTabContents: | 39 // two URLs that target the TestTabContents: |
40 // | 40 // |
41 // // Add a new tab and navigate it. This will be at index 0. | 41 // // Add a new tab and navigate it. This will be at index 0. |
42 // AddTab(browser(), GURL("http://foo/1")); | 42 // AddTab(browser(), GURL("http://foo/1")); |
43 // NavigationController* controller = | 43 // NavigationController* controller = |
44 // &browser()->GetTabContentsAt(0)->GetController(); | 44 // &chrome::GetTabContentsAt(browser(), 0)->GetController(); |
45 // | 45 // |
46 // // Navigate somewhere else. | 46 // // Navigate somewhere else. |
47 // GURL url2("http://foo/2"); | 47 // GURL url2("http://foo/2"); |
48 // NavigateAndCommit(controller, url2); | 48 // NavigateAndCommit(controller, url2); |
49 // | 49 // |
50 // // This is equivalent to the above, and lets you test pending navigations. | 50 // // This is equivalent to the above, and lets you test pending navigations. |
51 // browser()->OpenURL(OpenURLParams( | 51 // browser()->OpenURL(OpenURLParams( |
52 // GURL("http://foo/2"), GURL(), CURRENT_TAB, | 52 // GURL("http://foo/2"), GURL(), CURRENT_TAB, |
53 // content::PAGE_TRANSITION_TYPED, false)); | 53 // content::PAGE_TRANSITION_TYPED, false)); |
54 // CommitPendingLoad(controller); | 54 // CommitPendingLoad(controller); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 #endif | 126 #endif |
127 | 127 |
128 #if defined(OS_WIN) | 128 #if defined(OS_WIN) |
129 ui::ScopedOleInitializer ole_initializer_; | 129 ui::ScopedOleInitializer ole_initializer_; |
130 #endif | 130 #endif |
131 | 131 |
132 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest); | 132 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest); |
133 }; | 133 }; |
134 | 134 |
135 #endif // CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_ | 135 #endif // CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_ |
OLD | NEW |