| 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 #include "chrome/test/base/browser_with_test_window_test.h" | 5 #include "chrome/test/base/browser_with_test_window_test.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "components/constrained_window/constrained_window_views.h" | 30 #include "components/constrained_window/constrained_window_views.h" |
| 31 #endif | 31 #endif |
| 32 | 32 |
| 33 using content::NavigationController; | 33 using content::NavigationController; |
| 34 using content::RenderFrameHost; | 34 using content::RenderFrameHost; |
| 35 using content::RenderFrameHostTester; | 35 using content::RenderFrameHostTester; |
| 36 using content::WebContents; | 36 using content::WebContents; |
| 37 | 37 |
| 38 BrowserWithTestWindowTest::BrowserWithTestWindowTest() | 38 BrowserWithTestWindowTest::BrowserWithTestWindowTest() |
| 39 : browser_type_(Browser::TYPE_TABBED), | 39 : browser_type_(Browser::TYPE_TABBED), |
| 40 host_desktop_type_(chrome::HOST_DESKTOP_TYPE_NATIVE), | 40 host_desktop_type_(ui::HOST_DESKTOP_TYPE_NATIVE), |
| 41 hosted_app_(false) { | 41 hosted_app_(false) {} |
| 42 } | |
| 43 | 42 |
| 44 BrowserWithTestWindowTest::BrowserWithTestWindowTest( | 43 BrowserWithTestWindowTest::BrowserWithTestWindowTest( |
| 45 Browser::Type browser_type, | 44 Browser::Type browser_type, |
| 46 chrome::HostDesktopType host_desktop_type, | 45 ui::HostDesktopType host_desktop_type, |
| 47 bool hosted_app) | 46 bool hosted_app) |
| 48 : browser_type_(browser_type), | 47 : browser_type_(browser_type), |
| 49 host_desktop_type_(host_desktop_type), | 48 host_desktop_type_(host_desktop_type), |
| 50 hosted_app_(hosted_app) { | 49 hosted_app_(hosted_app) {} |
| 51 } | |
| 52 | 50 |
| 53 BrowserWithTestWindowTest::~BrowserWithTestWindowTest() { | 51 BrowserWithTestWindowTest::~BrowserWithTestWindowTest() { |
| 54 } | 52 } |
| 55 | 53 |
| 56 void BrowserWithTestWindowTest::SetUp() { | 54 void BrowserWithTestWindowTest::SetUp() { |
| 57 testing::Test::SetUp(); | 55 testing::Test::SetUp(); |
| 58 #if defined(OS_CHROMEOS) | 56 #if defined(OS_CHROMEOS) |
| 59 // TODO(jamescook): Windows Ash support. This will require refactoring | 57 // TODO(jamescook): Windows Ash support. This will require refactoring |
| 60 // AshTestHelper and AuraTestHelper so they can be used at the same time, | 58 // AshTestHelper and AuraTestHelper so they can be used at the same time, |
| 61 // perhaps by AshTestHelper owning an AuraTestHelper. | 59 // perhaps by AshTestHelper owning an AuraTestHelper. |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 } | 219 } |
| 222 | 220 |
| 223 BrowserWindow* BrowserWithTestWindowTest::CreateBrowserWindow() { | 221 BrowserWindow* BrowserWithTestWindowTest::CreateBrowserWindow() { |
| 224 return new TestBrowserWindow(); | 222 return new TestBrowserWindow(); |
| 225 } | 223 } |
| 226 | 224 |
| 227 Browser* BrowserWithTestWindowTest::CreateBrowser( | 225 Browser* BrowserWithTestWindowTest::CreateBrowser( |
| 228 Profile* profile, | 226 Profile* profile, |
| 229 Browser::Type browser_type, | 227 Browser::Type browser_type, |
| 230 bool hosted_app, | 228 bool hosted_app, |
| 231 chrome::HostDesktopType host_desktop_type, | 229 ui::HostDesktopType host_desktop_type, |
| 232 BrowserWindow* browser_window) { | 230 BrowserWindow* browser_window) { |
| 233 Browser::CreateParams params(profile, host_desktop_type); | 231 Browser::CreateParams params(profile, host_desktop_type); |
| 234 if (hosted_app) { | 232 if (hosted_app) { |
| 235 params = Browser::CreateParams::CreateForApp("Test", | 233 params = Browser::CreateParams::CreateForApp("Test", |
| 236 true /* trusted_source */, | 234 true /* trusted_source */, |
| 237 gfx::Rect(), | 235 gfx::Rect(), |
| 238 profile, | 236 profile, |
| 239 host_desktop_type); | 237 host_desktop_type); |
| 240 } else { | 238 } else { |
| 241 params.type = browser_type; | 239 params.type = browser_type; |
| 242 } | 240 } |
| 243 params.window = browser_window; | 241 params.window = browser_window; |
| 244 return new Browser(params); | 242 return new Browser(params); |
| 245 } | 243 } |
| OLD | NEW |