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