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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
12 #include "chrome/browser/extensions/unpacked_installer.h" | 12 #include "chrome/browser/extensions/unpacked_installer.h" |
13 #include "chrome/browser/ui/extensions/app_launch_params.h" | |
14 #include "chrome/browser/ui/extensions/application_launch.h" | 13 #include "chrome/browser/ui/extensions/application_launch.h" |
15 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
16 #include "chrome/test/remoting/key_code_conv.h" | 15 #include "chrome/test/remoting/key_code_conv.h" |
17 #include "chrome/test/remoting/page_load_notification_observer.h" | 16 #include "chrome/test/remoting/page_load_notification_observer.h" |
18 #include "chrome/test/remoting/waiter.h" | 17 #include "chrome/test/remoting/waiter.h" |
19 #include "content/public/browser/native_web_keyboard_event.h" | 18 #include "content/public/browser/native_web_keyboard_event.h" |
20 #include "content/public/browser/render_view_host.h" | 19 #include "content/public/browser/render_view_host.h" |
21 #include "content/public/test/test_utils.h" | 20 #include "content/public/test/test_utils.h" |
22 #include "extensions/browser/extension_registry.h" | 21 #include "extensions/browser/extension_registry.h" |
23 #include "extensions/common/constants.h" | 22 #include "extensions/common/constants.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 167 |
169 void RemoteDesktopBrowserTest::LaunchChromotingApp() { | 168 void RemoteDesktopBrowserTest::LaunchChromotingApp() { |
170 ASSERT_TRUE(extension_); | 169 ASSERT_TRUE(extension_); |
171 | 170 |
172 GURL chromoting_main = Chromoting_Main_URL(); | 171 GURL chromoting_main = Chromoting_Main_URL(); |
173 // We cannot simply wait for any page load because the first page | 172 // We cannot simply wait for any page load because the first page |
174 // loaded could be the generated background page. We need to wait | 173 // loaded could be the generated background page. We need to wait |
175 // till the chromoting main page is loaded. | 174 // till the chromoting main page is loaded. |
176 PageLoadNotificationObserver observer(chromoting_main); | 175 PageLoadNotificationObserver observer(chromoting_main); |
177 | 176 |
178 OpenApplication(AppLaunchParams(browser()->profile(), extension_, | 177 OpenApplication(AppLaunchParams( |
179 is_platform_app() | 178 browser()->profile(), |
180 ? extensions::LAUNCH_CONTAINER_NONE | 179 extension_, |
181 : extensions::LAUNCH_CONTAINER_TAB, | 180 is_platform_app() ? extensions::LAUNCH_CONTAINER_NONE : |
182 is_platform_app() ? NEW_WINDOW : CURRENT_TAB, | 181 extensions::LAUNCH_CONTAINER_TAB, |
183 extensions::SOURCE_UNTRACKED)); | 182 is_platform_app() ? NEW_WINDOW : CURRENT_TAB)); |
184 | 183 |
185 observer.Wait(); | 184 observer.Wait(); |
186 | 185 |
187 | 186 |
188 // The active WebContents instance should be the source of the LOAD_STOP | 187 // The active WebContents instance should be the source of the LOAD_STOP |
189 // notification. | 188 // notification. |
190 content::NavigationController* controller = | 189 content::NavigationController* controller = |
191 content::Source<content::NavigationController>(observer.source()).ptr(); | 190 content::Source<content::NavigationController>(observer.source()).ptr(); |
192 | 191 |
193 content::WebContents* web_contents = controller->GetWebContents(); | 192 content::WebContents* web_contents = controller->GetWebContents(); |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 // static | 886 // static |
888 bool RemoteDesktopBrowserTest::IsEnabled( | 887 bool RemoteDesktopBrowserTest::IsEnabled( |
889 content::WebContents* client_web_content, | 888 content::WebContents* client_web_content, |
890 const std::string& element_name) { | 889 const std::string& element_name) { |
891 return !ExecuteScriptAndExtractBool( | 890 return !ExecuteScriptAndExtractBool( |
892 client_web_content, | 891 client_web_content, |
893 "document.getElementById(\"" + element_name + "\").disabled"); | 892 "document.getElementById(\"" + element_name + "\").disabled"); |
894 } | 893 } |
895 | 894 |
896 } // namespace remoting | 895 } // namespace remoting |
OLD | NEW |