OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/remoting/remote_desktop_browsertest.h" | 5 #include "chrome/test/remoting/remote_desktop_browsertest.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 void RemoteDesktopBrowserTest::VerifyInternetAccess() { | 70 void RemoteDesktopBrowserTest::VerifyInternetAccess() { |
71 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( | 71 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( |
72 browser(), GURL("http://www.google.com"), 1); | 72 browser(), GURL("http://www.google.com"), 1); |
73 | 73 |
74 EXPECT_EQ(GetCurrentURL().host(), "www.google.com"); | 74 EXPECT_EQ(GetCurrentURL().host(), "www.google.com"); |
75 } | 75 } |
76 | 76 |
77 void RemoteDesktopBrowserTest::OpenClientBrowserPage() { | 77 void RemoteDesktopBrowserTest::OpenClientBrowserPage() { |
78 // Open the client browser page in a new tab | 78 // Open the client browser page in a new tab |
79 ui_test_utils::NavigateToURLWithDisposition( | 79 ui_test_utils::NavigateToURLWithDisposition( |
80 browser(), | 80 browser(), GURL(http_server() + "/client.html"), |
81 GURL(http_server() + "/client.html"), | 81 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
82 NEW_FOREGROUND_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); | 82 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); |
83 | 83 |
84 // Save this web content for later reference | 84 // Save this web content for later reference |
85 client_web_content_ = browser()->tab_strip_model()->GetActiveWebContents(); | 85 client_web_content_ = browser()->tab_strip_model()->GetActiveWebContents(); |
86 | 86 |
87 // Go back to the previous tab that has chromoting opened | 87 // Go back to the previous tab that has chromoting opened |
88 browser()->tab_strip_model()->SelectPreviousTab(); | 88 browser()->tab_strip_model()->SelectPreviousTab(); |
89 | 89 |
90 // Create the RemoteTestHelper object to use. | 90 // Create the RemoteTestHelper object to use. |
91 remote_test_helper_.reset(new RemoteTestHelper(client_web_content_)); | 91 remote_test_helper_.reset(new RemoteTestHelper(client_web_content_)); |
92 } | 92 } |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 188 |
189 // If the app should be started in deferred mode, ensure that a "source" URL | 189 // If the app should be started in deferred mode, ensure that a "source" URL |
190 // parameter is present; if not, ensure that no such parameter is present. | 190 // parameter is present; if not, ensure that no such parameter is present. |
191 // The value of the parameter is determined by the AppLaunchParams ("test", | 191 // The value of the parameter is determined by the AppLaunchParams ("test", |
192 // in this case). | 192 // in this case). |
193 extensions::FeatureSwitch::ScopedOverride override_trace_app_source( | 193 extensions::FeatureSwitch::ScopedOverride override_trace_app_source( |
194 extensions::FeatureSwitch::trace_app_source(), | 194 extensions::FeatureSwitch::trace_app_source(), |
195 defer_start); | 195 defer_start); |
196 | 196 |
197 if (is_platform_app()) { | 197 if (is_platform_app()) { |
198 window_open_disposition = NEW_WINDOW; | 198 window_open_disposition = WindowOpenDisposition::NEW_WINDOW; |
199 } | 199 } |
200 | 200 |
201 OpenApplication(AppLaunchParams(browser()->profile(), extension_, | 201 OpenApplication(AppLaunchParams(browser()->profile(), extension_, |
202 is_platform_app() | 202 is_platform_app() |
203 ? extensions::LAUNCH_CONTAINER_NONE | 203 ? extensions::LAUNCH_CONTAINER_NONE |
204 : extensions::LAUNCH_CONTAINER_TAB, | 204 : extensions::LAUNCH_CONTAINER_TAB, |
205 window_open_disposition, | 205 window_open_disposition, |
206 extensions::SOURCE_TEST)); | 206 extensions::SOURCE_TEST)); |
207 | 207 |
208 observer.Wait(); | 208 observer.Wait(); |
(...skipping 21 matching lines...) Expand all Loading... |
230 // to wait for so we can get rid of this wait. | 230 // to wait for so we can get rid of this wait. |
231 _ASSERT_TRUE(TimeoutWaiter(base::TimeDelta::FromSeconds(5)).Wait()); | 231 _ASSERT_TRUE(TimeoutWaiter(base::TimeDelta::FromSeconds(5)).Wait()); |
232 } | 232 } |
233 | 233 |
234 EXPECT_EQ(Chromoting_Main_URL(), GetCurrentURL()); | 234 EXPECT_EQ(Chromoting_Main_URL(), GetCurrentURL()); |
235 return web_contents; | 235 return web_contents; |
236 } | 236 } |
237 | 237 |
238 content::WebContents* RemoteDesktopBrowserTest::LaunchChromotingApp( | 238 content::WebContents* RemoteDesktopBrowserTest::LaunchChromotingApp( |
239 bool defer_start) { | 239 bool defer_start) { |
240 return LaunchChromotingApp(defer_start, CURRENT_TAB); | 240 return LaunchChromotingApp(defer_start, WindowOpenDisposition::CURRENT_TAB); |
241 } | 241 } |
242 | 242 |
243 void RemoteDesktopBrowserTest::StartChromotingApp() { | 243 void RemoteDesktopBrowserTest::StartChromotingApp() { |
244 ClickOnControl("browser-test-continue-init"); | 244 ClickOnControl("browser-test-continue-init"); |
245 } | 245 } |
246 | 246 |
247 void RemoteDesktopBrowserTest::Authorize() { | 247 void RemoteDesktopBrowserTest::Authorize() { |
248 // The chromoting extension should be installed. | 248 // The chromoting extension should be installed. |
249 ASSERT_TRUE(extension_); | 249 ASSERT_TRUE(extension_); |
250 | 250 |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 ConditionalTimeoutWaiter homeWaiter( | 956 ConditionalTimeoutWaiter homeWaiter( |
957 base::TimeDelta::FromSeconds(5), | 957 base::TimeDelta::FromSeconds(5), |
958 base::TimeDelta::FromMilliseconds(500), | 958 base::TimeDelta::FromMilliseconds(500), |
959 base::Bind(&RemoteDesktopBrowserTest::IsAppModeEqualTo, | 959 base::Bind(&RemoteDesktopBrowserTest::IsAppModeEqualTo, |
960 base::Unretained(this), | 960 base::Unretained(this), |
961 "remoting.AppMode.HOME")); | 961 "remoting.AppMode.HOME")); |
962 EXPECT_TRUE(homeWaiter.Wait()); | 962 EXPECT_TRUE(homeWaiter.Wait()); |
963 } | 963 } |
964 | 964 |
965 } // namespace remoting | 965 } // namespace remoting |
OLD | NEW |