| 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/common/constants.h" | 22 #include "extensions/common/constants.h" |
| 22 #include "extensions/common/extension.h" | 23 #include "extensions/common/extension.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 170 |
| 170 void RemoteDesktopBrowserTest::LaunchChromotingApp() { | 171 void RemoteDesktopBrowserTest::LaunchChromotingApp() { |
| 171 ASSERT_TRUE(extension_); | 172 ASSERT_TRUE(extension_); |
| 172 | 173 |
| 173 GURL chromoting_main = Chromoting_Main_URL(); | 174 GURL chromoting_main = Chromoting_Main_URL(); |
| 174 // We cannot simply wait for any page load because the first page | 175 // We cannot simply wait for any page load because the first page |
| 175 // loaded could be the generated background page. We need to wait | 176 // loaded could be the generated background page. We need to wait |
| 176 // till the chromoting main page is loaded. | 177 // till the chromoting main page is loaded. |
| 177 PageLoadNotificationObserver observer(chromoting_main); | 178 PageLoadNotificationObserver observer(chromoting_main); |
| 178 | 179 |
| 179 OpenApplication(AppLaunchParams( | 180 OpenApplication(AppLaunchParams(browser()->profile(), extension_, |
| 180 browser()->profile(), | 181 is_platform_app() |
| 181 extension_, | 182 ? extensions::LAUNCH_CONTAINER_NONE |
| 182 is_platform_app() ? extensions::LAUNCH_CONTAINER_NONE : | 183 : extensions::LAUNCH_CONTAINER_TAB, |
| 183 extensions::LAUNCH_CONTAINER_TAB, | 184 is_platform_app() ? NEW_WINDOW : CURRENT_TAB, |
| 184 is_platform_app() ? NEW_WINDOW : CURRENT_TAB)); | 185 extensions::SOURCE_UNTRACKED)); |
| 185 | 186 |
| 186 observer.Wait(); | 187 observer.Wait(); |
| 187 | 188 |
| 188 | 189 |
| 189 // The active WebContents instance should be the source of the LOAD_STOP | 190 // The active WebContents instance should be the source of the LOAD_STOP |
| 190 // notification. | 191 // notification. |
| 191 content::NavigationController* controller = | 192 content::NavigationController* controller = |
| 192 content::Source<content::NavigationController>(observer.source()).ptr(); | 193 content::Source<content::NavigationController>(observer.source()).ptr(); |
| 193 | 194 |
| 194 content::WebContents* web_contents = controller->GetWebContents(); | 195 content::WebContents* web_contents = controller->GetWebContents(); |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 // static | 860 // static |
| 860 bool RemoteDesktopBrowserTest::IsEnabled( | 861 bool RemoteDesktopBrowserTest::IsEnabled( |
| 861 content::WebContents* client_web_content, | 862 content::WebContents* client_web_content, |
| 862 const std::string& element_name) { | 863 const std::string& element_name) { |
| 863 return !ExecuteScriptAndExtractBool( | 864 return !ExecuteScriptAndExtractBool( |
| 864 client_web_content, | 865 client_web_content, |
| 865 "document.getElementById(\"" + element_name + "\").disabled"); | 866 "document.getElementById(\"" + element_name + "\").disabled"); |
| 866 } | 867 } |
| 867 | 868 |
| 868 } // namespace remoting | 869 } // namespace remoting |
| OLD | NEW |