OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_TEST_REMOTING_REMOTE_DESKTOP_BROWSERTEST_H_ | 5 #ifndef CHROME_TEST_REMOTING_REMOTE_DESKTOP_BROWSERTEST_H_ |
6 #define CHROME_TEST_REMOTING_REMOTE_DESKTOP_BROWSERTEST_H_ | 6 #define CHROME_TEST_REMOTING_REMOTE_DESKTOP_BROWSERTEST_H_ |
7 | 7 |
8 #include "base/debug/stack_trace.h" | 8 #include "base/debug/stack_trace.h" |
9 #include "chrome/browser/apps/app_browsertest_util.h" | 9 #include "chrome/browser/apps/app_browsertest_util.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
11 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
12 #include "chrome/test/base/ui_test_utils.h" | 12 #include "chrome/test/base/ui_test_utils.h" |
13 #include "content/public/browser/notification_service.h" | 13 #include "content/public/browser/notification_service.h" |
14 #include "content/public/test/browser_test_utils.h" | 14 #include "content/public/test/browser_test_utils.h" |
15 #include "net/dns/mock_host_resolver.h" | 15 #include "net/dns/mock_host_resolver.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 // Command line arguments specific to the chromoting browser tests. | 18 // Command line arguments specific to the chromoting browser tests. |
19 const char kOverrideUserDataDir[] = "override-user-data-dir"; | 19 const char kOverrideUserDataDir[] = "override-user-data-dir"; |
20 const char kNoCleanup[] = "no-cleanup"; | 20 const char kNoCleanup[] = "no-cleanup"; |
21 const char kNoInstall[] = "no-install"; | 21 const char kNoInstall[] = "no-install"; |
22 const char kWebAppCrx[] = "webapp-crx"; | 22 const char kWebAppCrx[] = "webapp-crx"; |
23 const char kWebAppUnpacked[] = "webapp-unpacked"; | 23 const char kWebAppUnpacked[] = "webapp-unpacked"; |
24 const char kUsername[] = "username"; | 24 const char kUserNameField[] = "username"; |
weitao
2014/10/08 23:19:16
Isn't it called "user-name" in the json file?
anandc
2014/10/09 00:15:24
It was "user_name", but I then updated it to "user
| |
25 const char kkPassword[] = "password"; | 25 const char kPasswordField[] = "password"; |
26 const char kAccountsFile[] = "accounts-file"; | |
27 const char kAccountType[] = "account-type"; | |
26 const char kMe2MePin[] = "me2me-pin"; | 28 const char kMe2MePin[] = "me2me-pin"; |
27 const char kRemoteHostName[] = "remote-host-name"; | 29 const char kRemoteHostName[] = "remote-host-name"; |
28 const char kExtensionName[] = "extension-name"; | 30 const char kExtensionName[] = "extension-name"; |
29 const char kHttpServer[] = "http-server"; | 31 const char kHttpServer[] = "http-server"; |
30 | 32 |
31 // ASSERT_TRUE can only be used in void returning functions. This version | 33 // ASSERT_TRUE can only be used in void returning functions. This version |
32 // should be used in non-void-returning functions. | 34 // should be used in non-void-returning functions. |
33 inline void _ASSERT_TRUE(bool condition) { | 35 inline void _ASSERT_TRUE(bool condition) { |
34 if (!condition) { | 36 if (!condition) { |
35 // ASSERT_TRUE only prints the first call frame in the error message. | 37 // ASSERT_TRUE only prints the first call frame in the error message. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 // Simulate typing a string | 120 // Simulate typing a string |
119 void SimulateStringInput(const std::string& input); | 121 void SimulateStringInput(const std::string& input); |
120 | 122 |
121 // Helper to simulate a left button mouse click. | 123 // Helper to simulate a left button mouse click. |
122 void SimulateMouseLeftClickAt(int x, int y); | 124 void SimulateMouseLeftClickAt(int x, int y); |
123 | 125 |
124 // Helper to simulate a mouse click. | 126 // Helper to simulate a mouse click. |
125 void SimulateMouseClickAt( | 127 void SimulateMouseClickAt( |
126 int modifiers, blink::WebMouseEvent::Button button, int x, int y); | 128 int modifiers, blink::WebMouseEvent::Button button, int x, int y); |
127 | 129 |
130 bool SetUserNameAndPassword(const base::FilePath &accounts_file); | |
131 | |
128 // The following helpers each perform a composite task. | 132 // The following helpers each perform a composite task. |
129 | 133 |
130 // Install the chromoting extension | 134 // Install the chromoting extension |
131 void Install(); | 135 void Install(); |
132 | 136 |
133 // Perform all necessary steps (installation, authorization, authentication, | 137 // Perform all necessary steps (installation, authorization, authentication, |
134 // expanding the me2me section) so that the app is ready for a me2me | 138 // expanding the me2me section) so that the app is ready for a me2me |
135 // connection. | 139 // connection. |
136 void SetUpTestForMe2Me(); | 140 void SetUpTestForMe2Me(); |
137 | 141 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
358 // WebContent of the landing page in the chromoting app. | 362 // WebContent of the landing page in the chromoting app. |
359 content::WebContents* app_web_content_; | 363 content::WebContents* app_web_content_; |
360 | 364 |
361 bool no_cleanup_; | 365 bool no_cleanup_; |
362 bool no_install_; | 366 bool no_install_; |
363 const Extension* extension_; | 367 const Extension* extension_; |
364 base::FilePath webapp_crx_; | 368 base::FilePath webapp_crx_; |
365 base::FilePath webapp_unpacked_; | 369 base::FilePath webapp_unpacked_; |
366 std::string username_; | 370 std::string username_; |
367 std::string password_; | 371 std::string password_; |
372 std::string accounts_file_; | |
weitao
2014/10/08 23:19:16
Why store the file path if it's not used anywhere
anandc
2014/10/09 00:15:24
Done.
| |
373 std::string account_type_; | |
weitao
2014/10/08 23:19:16
Same as above.
anandc
2014/10/09 00:15:24
Done.
| |
368 std::string me2me_pin_; | 374 std::string me2me_pin_; |
369 std::string remote_host_name_; | 375 std::string remote_host_name_; |
370 std::string extension_name_; | 376 std::string extension_name_; |
371 std::string http_server_; | 377 std::string http_server_; |
372 }; | 378 }; |
373 | 379 |
374 } // namespace remoting | 380 } // namespace remoting |
375 | 381 |
376 #endif // CHROME_TEST_REMOTING_REMOTE_DESKTOP_BROWSERTEST_H_ | 382 #endif // CHROME_TEST_REMOTING_REMOTE_DESKTOP_BROWSERTEST_H_ |
OLD | NEW |