| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "chrome/browser/chrome_thread.h" |
| 12 #include "chrome/browser/renderer_host/test/test_render_view_host.h" | 13 #include "chrome/browser/renderer_host/test/test_render_view_host.h" |
| 13 #include "chrome/test/test_browser_window.h" | 14 #include "chrome/test/test_browser_window.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 16 |
| 16 class Browser; | 17 class Browser; |
| 17 class GURL; | 18 class GURL; |
| 18 class NavigationController; | 19 class NavigationController; |
| 19 class TestBrowserWindow; | 20 class TestBrowserWindow; |
| 20 class TestingProfile; | 21 class TestingProfile; |
| 21 | 22 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // given URL with the default parameters and the commits the load with a page | 82 // given URL with the default parameters and the commits the load with a page |
| 82 // ID one larger than any seen. This emulates what happens on a new | 83 // ID one larger than any seen. This emulates what happens on a new |
| 83 // navigation. | 84 // navigation. |
| 84 void NavigateAndCommit(NavigationController* controller, | 85 void NavigateAndCommit(NavigationController* controller, |
| 85 const GURL& url); | 86 const GURL& url); |
| 86 | 87 |
| 87 // Navigates the current tab. This is a wrapper around NavigateAndCommit. | 88 // Navigates the current tab. This is a wrapper around NavigateAndCommit. |
| 88 void NavigateAndCommitActiveTab(const GURL& url); | 89 void NavigateAndCommitActiveTab(const GURL& url); |
| 89 | 90 |
| 90 private: | 91 private: |
| 92 |
| 91 // We need to create a MessageLoop, otherwise a bunch of things fails. | 93 // We need to create a MessageLoop, otherwise a bunch of things fails. |
| 92 MessageLoopForUI ui_loop_; | 94 MessageLoopForUI ui_loop_; |
| 95 ChromeThread ui_thread_; |
| 93 | 96 |
| 94 scoped_ptr<TestingProfile> profile_; | 97 scoped_ptr<TestingProfile> profile_; |
| 95 scoped_ptr<TestBrowserWindow> window_; | 98 scoped_ptr<TestBrowserWindow> window_; |
| 96 scoped_ptr<Browser> browser_; | 99 scoped_ptr<Browser> browser_; |
| 97 | 100 |
| 98 MockRenderProcessHostFactory rph_factory_; | 101 MockRenderProcessHostFactory rph_factory_; |
| 99 TestRenderViewHostFactory rvh_factory_; | 102 TestRenderViewHostFactory rvh_factory_; |
| 100 | 103 |
| 101 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest); | 104 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest); |
| 102 }; | 105 }; |
| 103 | 106 |
| 104 #endif // CHROME_TEST_BROWSER_WITH_TEST_WINDOW_TEST_H_ | 107 #endif // CHROME_TEST_BROWSER_WITH_TEST_WINDOW_TEST_H_ |
| OLD | NEW |