OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/test/remoting/remote_desktop_browsertest.h" | |
6 | |
7 namespace remoting { | |
8 | |
9 class It2MeBrowserTest : public RemoteDesktopBrowserTest { | |
10 protected: | |
11 void SetUpTestForIt2Me(); | |
12 std::string GetAccessCode(content::WebContents* contents); | |
13 }; | |
14 | |
15 void It2MeBrowserTest::SetUpTestForIt2Me() { | |
16 VerifyInternetAccess(); | |
17 Install(); | |
18 LaunchChromotingApp(false); | |
19 Auth(); | |
20 LoadScript(app_web_content(), FILE_PATH_LITERAL("browser_test.js")); | |
Jamie
2015/01/06 22:18:51
This is basically the same code as RemoteDesktopBr
kelvinp
2015/01/09 22:21:30
Removed.
| |
21 } | |
22 | |
23 std::string It2MeBrowserTest::GetAccessCode(content::WebContents* contents) { | |
24 base::Value* return_value = nullptr; | |
25 RunJavaScriptTest(contents, "GET_ACCESS_CODE", "{}", &return_value); | |
Jamie
2015/01/06 22:18:51
GET_ACCESS_CODE is not a test in the same sense th
kelvinp
2015/01/09 22:21:29
Discussed offline
| |
26 scoped_ptr<base::Value> owned_value(return_value); | |
27 std::string access_code; | |
28 owned_value->GetAsString(&access_code); | |
29 return access_code; | |
30 } | |
31 | |
32 IN_PROC_BROWSER_TEST_F(It2MeBrowserTest, MANUAL_Connect) { | |
33 SetUpTestForIt2Me(); | |
34 | |
35 content::WebContents* helpee_content = app_web_content(); | |
36 LoadScript(helpee_content, FILE_PATH_LITERAL("it2me_browser_test.js")); | |
37 | |
38 LaunchChromotingApp(false /* defer_start*/, NEW_FOREGROUND_TAB); | |
Jamie
2015/01/06 22:18:51
Does NEW_FOREGROUND_TAB work for apps v2?
Jamie
2015/01/06 22:18:51
We haven't documented the |false| parameter anywhe
kelvinp
2015/01/09 22:21:29
Good point. Comment added and modified the code t
kelvinp
2015/01/09 22:21:30
Done.
| |
39 content::WebContents* helper_content = active_web_contents(); | |
Jamie
2015/01/06 22:18:51
Would it be possible to return the web contents fr
kelvinp
2015/01/09 22:21:30
Done.
| |
40 LoadScript(helper_content, FILE_PATH_LITERAL("browser_test.js")); | |
41 LoadScript(helper_content, FILE_PATH_LITERAL("it2me_browser_test.js")); | |
42 | |
43 RunJavaScriptTest(helper_content, "CONNECT_IT2ME", "{" | |
44 "accessCode: '" + GetAccessCode(helpee_content) + "'" | |
45 "}"); | |
46 | |
47 Cleanup(); | |
48 } | |
Jamie
2015/01/06 22:18:51
Can you also add a test to make sure that trying t
kelvinp
2015/01/09 22:21:30
Done.
| |
49 | |
50 } // namespace remoting | |
OLD | NEW |