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_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_TEST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_TEST_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_TEST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_TEST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
11 #include "url/gurl.h" | 11 #include "url/gurl.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class CommandLine; | 14 class CommandLine; |
15 } // namespace base | 15 } // namespace base |
16 | 16 |
17 class WebstoreInstallerTest : public InProcessBrowserTest { | 17 class WebstoreInstallerTest : public InProcessBrowserTest { |
18 public: | 18 public: |
19 WebstoreInstallerTest(const std::string& webstore_domain, | 19 WebstoreInstallerTest(const std::string& webstore_domain, |
20 const std::string& test_data_path, | 20 const std::string& test_data_path, |
21 const std::string& crx_filename, | 21 const std::string& crx_filename, |
22 const std::string& verified_domain, | 22 const std::string& verified_domain, |
23 const std::string& unverified_domain); | 23 const std::string& unverified_domain); |
24 virtual ~WebstoreInstallerTest(); | 24 virtual ~WebstoreInstallerTest(); |
25 | 25 |
26 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; | 26 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; |
27 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; | 27 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; |
28 | 28 |
29 protected: | 29 protected: |
30 GURL GenerateTestServerUrl(const std::string& domain, | 30 GURL GenerateTestServerUrl(const std::string& domain, |
31 const std::string& page_filename); | 31 const std::string& page_filename); |
32 | 32 |
33 void RunTest(const std::string& test_function_name); | 33 void RunTest(const std::string& test_function_name); |
34 | 34 |
35 // Passes |i| to |test_function_name|, and expects that function to | 35 // Passes |i| to |test_function_name|, and expects that function to |
36 // return one of "FAILED", "KEEPGOING" or "DONE". KEEPGOING should be | 36 // return one of "FAILED", "KEEPGOING" or "DONE". KEEPGOING should be |
37 // returned if more tests remain to be run and the current test succeeded, | 37 // returned if more tests remain to be run and the current test succeeded, |
38 // FAILED is returned when a test fails, and DONE is returned by the last | 38 // FAILED is returned when a test fails, and DONE is returned by the last |
39 // test if it succeeds. | 39 // test if it succeeds. |
40 // This methods returns true iff there are more tests that need to be run. | 40 // This methods returns true iff there are more tests that need to be run. |
41 bool RunIndexedTest(const std::string& test_function_name, int i); | 41 bool RunIndexedTest(const std::string& test_function_name, int i); |
42 | 42 |
43 // Runs a test without waiting for any results from the renderer. | 43 // Runs a test without waiting for any results from the renderer. |
44 void RunTestAsync(const std::string& test_function_name); | 44 void RunTestAsync(const std::string& test_function_name); |
45 | 45 |
46 std::string webstore_domain_; | 46 std::string webstore_domain_; |
47 std::string test_data_path_; | 47 std::string test_data_path_; |
48 std::string crx_filename_; | 48 std::string crx_filename_; |
49 std::string verified_domain_; | 49 std::string verified_domain_; |
50 std::string unverified_domain_; | 50 std::string unverified_domain_; |
51 std::string test_gallery_url_; | 51 std::string test_gallery_url_; |
52 }; | 52 }; |
53 | 53 |
54 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_TEST_H_ | 54 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INSTALLER_TEST_H_ |
OLD | NEW |