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

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

Issue 398823005: Automate host start up in browser test (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months 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/browser_test/browser_test.js » ('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 8cd1e505703fc93b1cf37b3d2863c8fda0d1c337..1c5288c188ebd9f1feaf1fd7528466501d59d893 100644
--- a/chrome/test/remoting/remote_desktop_browsertest.cc
+++ b/chrome/test/remoting/remote_desktop_browsertest.cc
@@ -343,27 +343,12 @@ void RemoteDesktopBrowserTest::ExpandMe2Me() {
EXPECT_TRUE(HtmlElementVisible("me2me-content"));
EXPECT_FALSE(HtmlElementVisible("me2me-first-run"));
-
- // Wait until localHost is initialized. This can take a while.
- ConditionalTimeoutWaiter waiter(
- base::TimeDelta::FromSeconds(3),
- base::TimeDelta::FromSeconds(1),
- base::Bind(&RemoteDesktopBrowserTest::IsLocalHostReady, this));
- EXPECT_TRUE(waiter.Wait());
-
- EXPECT_TRUE(ExecuteScriptAndExtractBool(
- "remoting.hostList.localHost_.hostName && "
- "remoting.hostList.localHost_.hostId && "
- "remoting.hostList.localHost_.status && "
- "remoting.hostList.localHost_.status == 'ONLINE'"));
}
void RemoteDesktopBrowserTest::DisconnectMe2Me() {
// The chromoting extension should be installed.
ASSERT_TRUE(extension_);
- // The active tab should have the chromoting app loaded.
- ASSERT_EQ(Chromoting_Main_URL(), GetCurrentURL());
ASSERT_TRUE(RemoteDesktopBrowserTest::IsSessionConnected());
ClickOnControl("toolbar-stub");
@@ -483,9 +468,10 @@ void RemoteDesktopBrowserTest::SetUpTestForMe2Me() {
VerifyInternetAccess();
Install();
LaunchChromotingApp();
+ LoadScript(app_web_content(), FILE_PATH_LITERAL("browser_test.js"));
Auth();
ExpandMe2Me();
- LoadScript(app_web_content(), FILE_PATH_LITERAL("browser_test.js"));
+ EnsureRemoteConnectionEnabled();
}
void RemoteDesktopBrowserTest::Auth() {
@@ -494,6 +480,20 @@ void RemoteDesktopBrowserTest::Auth() {
Approve();
}
+void RemoteDesktopBrowserTest::EnsureRemoteConnectionEnabled() {
+ // browser_test.ensureRemoteConnectionEnabled is defined in
+ // browser_test.js, which must be loaded before calling this function.
+ // TODO(kelvinp): This function currently only works on linux when the user is
+ // already part of the chrome-remote-desktop group. Extend this functionality
+ // to Mac (https://crbug.com/397576) and Windows (https://crbug.com/397575).
+ bool result;
+ EXPECT_TRUE(content::ExecuteScriptAndExtractBool(
+ app_web_content(),
+ "browserTest.ensureRemoteConnectionEnabled(" + me2me_pin() + ")",
+ &result));
+ EXPECT_TRUE(result) << "Cannot start the host with Pin:" << me2me_pin();
+}
+
void RemoteDesktopBrowserTest::ConnectToLocalHost(bool remember_pin) {
// Verify that the local host is online.
ASSERT_TRUE(ExecuteScriptAndExtractBool(
« no previous file with comments | « chrome/test/remoting/remote_desktop_browsertest.h ('k') | remoting/webapp/browser_test/browser_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698