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

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
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..f01c37aeccb17ba4fdc9695c3891d590d156b7cd 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(
kelvinp 2014/07/19 01:18:58 After the CL, we no longer assumes that the host i
Jamie 2014/07/22 18:47:11 Acknowledged.
- 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());
kelvinp 2014/07/19 01:18:58 This assert fails as after a PIN setup. The URL i
Jamie 2014/07/22 18:47:11 Acknowledged.
ASSERT_TRUE(RemoteDesktopBrowserTest::IsSessionConnected());
ClickOnControl("toolbar-stub");
@@ -486,6 +471,7 @@ void RemoteDesktopBrowserTest::SetUpTestForMe2Me() {
Auth();
ExpandMe2Me();
LoadScript(app_web_content(), FILE_PATH_LITERAL("browser_test.js"));
weitao 2014/07/21 18:53:45 Ideally, loading the test script is a setup step a
kelvinp 2014/07/23 22:22:26 Done.
+ EnsureRemoteConnectionEnabled();
}
void RemoteDesktopBrowserTest::Auth() {
@@ -494,6 +480,17 @@ void RemoteDesktopBrowserTest::Auth() {
Approve();
}
+void RemoteDesktopBrowserTest::EnsureRemoteConnectionEnabled() {
+ // browser_test.ensureRemoteConnectionEnabled is defined in
+ // browser_test.js, which must be loaded before calling this function.
+ 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();
Jamie 2014/07/22 18:47:11 Unless the PIN is likely to be a reason for failur
kelvinp 2014/07/23 22:22:26 The EXPECT_TRUE will ONLY log when the setup fails
+}
+
void RemoteDesktopBrowserTest::ConnectToLocalHost(bool remember_pin) {
// Verify that the local host is online.
ASSERT_TRUE(ExecuteScriptAndExtractBool(

Powered by Google App Engine
This is Rietveld 408576698