Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4030)

Unified Diff: chrome/test/remoting/remote_desktop_browsertest.cc

Issue 771003002: Add support for deferring app initialization when testing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/remoting/remote_desktop_browsertest.cc
diff --git a/chrome/test/remoting/remote_desktop_browsertest.cc b/chrome/test/remoting/remote_desktop_browsertest.cc
index 80160d5312f52ce1cb223806d121ff9b81e99a34..b7fa8d0d87287dc8fd83d646b285063960442382 100644
--- a/chrome/test/remoting/remote_desktop_browsertest.cc
+++ b/chrome/test/remoting/remote_desktop_browsertest.cc
@@ -166,7 +166,7 @@ void RemoteDesktopBrowserTest::VerifyChromotingLoaded(bool expected) {
ASSERT_EQ(installed, expected);
}
-void RemoteDesktopBrowserTest::LaunchChromotingApp() {
+void RemoteDesktopBrowserTest::LaunchChromotingApp(bool defer_start) {
ASSERT_TRUE(extension_);
GURL chromoting_main = Chromoting_Main_URL();
@@ -174,13 +174,26 @@ void RemoteDesktopBrowserTest::LaunchChromotingApp() {
// loaded could be the generated background page. We need to wait
// till the chromoting main page is loaded.
PageLoadNotificationObserver observer(chromoting_main);
+ observer.set_ignore_url_parameters(true);
+
+ extensions::FeatureSwitch::ScopedOverride enable_trace_app_source(
+ extensions::FeatureSwitch::trace_app_source(),
+ true);
+
+ // Lacking any other convenient mechanism for passing a URL parameter to the
+ // web-app, we use the |source| field. Since there's no way to launch the
+ // app from the About page, this should never be encountered by real users,
+ // even if they have the trace_app_source command-line option enabled.
Jamie 2014/12/02 01:30:13 cylee@: What I would like to do here is add a BROW
cylee1 2014/12/02 14:10:32 Adding a new enum BROWSER_TEST sounds much reasona
+ extensions::AppLaunchSource source =
+ defer_start ? extensions::SOURCE_ABOUT_PAGE
+ : extensions::SOURCE_UNTRACKED;
OpenApplication(AppLaunchParams(browser()->profile(), extension_,
is_platform_app()
? extensions::LAUNCH_CONTAINER_NONE
: extensions::LAUNCH_CONTAINER_TAB,
is_platform_app() ? NEW_WINDOW : CURRENT_TAB,
- extensions::SOURCE_UNTRACKED));
+ source));
observer.Wait();
@@ -210,6 +223,10 @@ void RemoteDesktopBrowserTest::LaunchChromotingApp() {
EXPECT_EQ(Chromoting_Main_URL(), GetCurrentURL());
}
+void RemoteDesktopBrowserTest::StartChromotingApp() {
+ ClickOnControl("browser-test-continue-init");
+};
+
void RemoteDesktopBrowserTest::Authorize() {
// The chromoting extension should be installed.
ASSERT_TRUE(extension_);
@@ -465,7 +482,7 @@ void RemoteDesktopBrowserTest::Cleanup() {
void RemoteDesktopBrowserTest::SetUpTestForMe2Me() {
VerifyInternetAccess();
Install();
- LaunchChromotingApp();
+ LaunchChromotingApp(false);
Auth();
LoadScript(app_web_content(), FILE_PATH_LITERAL("browser_test.js"));
ExpandMe2Me();

Powered by Google App Engine
This is Rietveld 408576698