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

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: Improved comment. 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
« no previous file with comments | « chrome/test/remoting/remote_desktop_browsertest.h ('k') | remoting/webapp/crd/html/template_main.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d5f3ee107cc3aec1b11bdd7ec4518fa60dae9f88..5c5f2b4031803b55c3a5fc1a145280a64c0ea933 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,6 +174,14 @@ 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);
+
+ // If the app should be started in deferred mode, ensure that a "source" URL
+ // parameter; if not, ensure that no such parameter is present. The value of
+ // the parameter is determined by the AppLaunchParams ("test", in this case).
+ extensions::FeatureSwitch::ScopedOverride override_trace_app_source(
+ extensions::FeatureSwitch::trace_app_source(),
+ defer_start);
OpenApplication(AppLaunchParams(browser()->profile(), extension_,
is_platform_app()
@@ -210,6 +218,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 +477,7 @@ void RemoteDesktopBrowserTest::Cleanup() {
void RemoteDesktopBrowserTest::SetUpTestForMe2Me() {
VerifyInternetAccess();
Install();
- LaunchChromotingApp();
+ LaunchChromotingApp(false);
Auth();
LoadScript(app_web_content(), FILE_PATH_LITERAL("browser_test.js"));
ExpandMe2Me();
« no previous file with comments | « chrome/test/remoting/remote_desktop_browsertest.h ('k') | remoting/webapp/crd/html/template_main.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698