| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_BROWSER_WITH_TEST_WINDOW_TEST_H_ | 5 #ifndef CHROME_TEST_BROWSER_WITH_TEST_WINDOW_TEST_H_ |
| 6 #define CHROME_TEST_BROWSER_WITH_TEST_WINDOW_TEST_H_ | 6 #define CHROME_TEST_BROWSER_WITH_TEST_WINDOW_TEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 BrowserWithTestWindowTest(); | 44 BrowserWithTestWindowTest(); |
| 45 virtual ~BrowserWithTestWindowTest(); | 45 virtual ~BrowserWithTestWindowTest(); |
| 46 | 46 |
| 47 virtual void SetUp(); | 47 virtual void SetUp(); |
| 48 | 48 |
| 49 // Returns the current RenderViewHost for the current tab as a | 49 // Returns the current RenderViewHost for the current tab as a |
| 50 // TestRenderViewHost. | 50 // TestRenderViewHost. |
| 51 TestRenderViewHost* TestRenderViewHostForTab(TabContents* tab_contents); | 51 TestRenderViewHost* TestRenderViewHostForTab(TabContents* tab_contents); |
| 52 | 52 |
| 53 protected: | 53 protected: |
| 54 | |
| 55 TestBrowserWindow* window() const { return window_.get(); } | 54 TestBrowserWindow* window() const { return window_.get(); } |
| 56 void set_window(TestBrowserWindow* window) { | 55 void set_window(TestBrowserWindow* window) { |
| 57 window_.reset(window); | 56 window_.reset(window); |
| 58 } | 57 } |
| 59 | 58 |
| 60 Browser* browser() const { return browser_.get(); } | 59 Browser* browser() const { return browser_.get(); } |
| 61 void set_browser(Browser* browser) { | 60 void set_browser(Browser* browser) { |
| 62 browser_.reset(browser); | 61 browser_.reset(browser); |
| 63 } | 62 } |
| 64 | 63 |
| 65 TestingProfile* profile() const { return profile_.get(); } | 64 TestingProfile* profile() const { return profile_.get(); } |
| 66 void set_profile(TestingProfile* profile) { | 65 void set_profile(TestingProfile* profile) { |
| 67 profile_.reset(profile); | 66 profile_.reset(profile); |
| 68 } | 67 } |
| 69 | 68 |
| 69 MessageLoop* message_loop() { return &ui_loop_; } |
| 70 |
| 70 // Adds a tab to |browser| with the given URL and commits the load. | 71 // Adds a tab to |browser| with the given URL and commits the load. |
| 71 // This is a convenience function. The new tab will be added at index 0. | 72 // This is a convenience function. The new tab will be added at index 0. |
| 72 void AddTab(Browser* browser, const GURL& url); | 73 void AddTab(Browser* browser, const GURL& url); |
| 73 | 74 |
| 74 // Commits the pending load on the given controller. It will keep the | 75 // Commits the pending load on the given controller. It will keep the |
| 75 // URL of the pending load. If there is no pending load, this does nothing. | 76 // URL of the pending load. If there is no pending load, this does nothing. |
| 76 void CommitPendingLoad(NavigationController* controller); | 77 void CommitPendingLoad(NavigationController* controller); |
| 77 | 78 |
| 78 // Creates a pending navigation on the given navigation controller to the | 79 // Creates a pending navigation on the given navigation controller to the |
| 79 // given URL with the default parameters and the commits the load with a page | 80 // given URL with the default parameters and the commits the load with a page |
| (...skipping 13 matching lines...) Expand all Loading... |
| 93 scoped_ptr<TestBrowserWindow> window_; | 94 scoped_ptr<TestBrowserWindow> window_; |
| 94 scoped_ptr<Browser> browser_; | 95 scoped_ptr<Browser> browser_; |
| 95 | 96 |
| 96 MockRenderProcessHostFactory rph_factory_; | 97 MockRenderProcessHostFactory rph_factory_; |
| 97 TestRenderViewHostFactory rvh_factory_; | 98 TestRenderViewHostFactory rvh_factory_; |
| 98 | 99 |
| 99 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest); | 100 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest); |
| 100 }; | 101 }; |
| 101 | 102 |
| 102 #endif // CHROME_TEST_BROWSER_WITH_TEST_WINDOW_TEST_H_ | 103 #endif // CHROME_TEST_BROWSER_WITH_TEST_WINDOW_TEST_H_ |
| OLD | NEW |