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

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

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.h
diff --git a/chrome/test/remoting/remote_desktop_browsertest.h b/chrome/test/remoting/remote_desktop_browsertest.h
index 373ae6bed981180b0b87e8a5ac2ad894055017d2..7ec09817c82b90a1f644b3595142b52d4d2cb76a 100644
--- a/chrome/test/remoting/remote_desktop_browsertest.h
+++ b/chrome/test/remoting/remote_desktop_browsertest.h
@@ -86,8 +86,16 @@ class RemoteDesktopBrowserTest : public extensions::PlatformAppBrowserTest {
// Test whether the chromoting extension is installed.
void VerifyChromotingLoaded(bool expected);
- // Launch the chromoting app.
- void LaunchChromotingApp();
+ // Launch the Chromoting app. If |defer_start| is true, an additional URL
+ // parameter is passed to the application, causing it to defer start-up
+ // until StartChromotingApp is invoked. Test code can execute arbitrary
+ // JavaScript in the context of the app between these two calls, for example
+ // to set up appropriate mocks.
+ void LaunchChromotingApp(bool defer_start);
+
+ // If the Chromoting app was launched in deferred mode, tell it to continue
+ // its regular start-up sequence.
+ void StartChromotingApp();
// Authorize: grant extended access permission to the user's computer.
void Authorize();
@@ -223,19 +231,16 @@ class RemoteDesktopBrowserTest : public extensions::PlatformAppBrowserTest {
// Helper to construct the starting URL of the installed chromoting webapp.
GURL Chromoting_Main_URL() {
- if (is_platform_app())
- // The v2 remoting app recently (M38 at the latest) started adding a
- // query-string parameter to the main extension page. So we'll create a
- // different expected URL for it.
- return GURL("chrome-extension://" + ChromotingID() +
- "/main.html?isKioskSession=false");
- else
- return GURL("chrome-extension://" + ChromotingID() + "/main.html");
+ return GURL("chrome-extension://" + ChromotingID() + "/main.html");
weitao 2014/12/12 22:49:52 Does the V2 app no longer include isKioskSession i
Jamie 2014/12/13 01:03:43 Yes it does, but I've modified the URL matcher to
}
- // Helper to retrieve the current URL in the active WebContents.
+ // Helper to retrieve the current URL in the active WebContents. This function
+ // strips all query parameters from the URL.
GURL GetCurrentURL() {
- return active_web_contents()->GetURL();
+ GURL current_url = active_web_contents()->GetURL();
+ GURL::Replacements strip_query;
+ strip_query.ClearQuery();
+ return current_url.ReplaceComponents(strip_query);
}
// Helpers to execute JavaScript code on a web page.

Powered by Google App Engine
This is Rietveld 408576698