OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_PPAPI_UITEST_H_ | 5 #ifndef CHROME_TEST_UI_PPAPI_UITEST_H_ |
6 #define CHROME_TEST_UI_PPAPI_UITEST_H_ | 6 #define CHROME_TEST_UI_PPAPI_UITEST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "chrome/test/base/in_process_browser_test.h" | 11 #include "chrome/test/base/in_process_browser_test.h" |
12 | 12 |
13 class PPAPITestBase : public InProcessBrowserTest { | 13 class PPAPITestBase : public InProcessBrowserTest { |
14 public: | 14 public: |
15 PPAPITestBase(); | 15 PPAPITestBase(); |
16 | 16 |
17 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; | 17 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; |
18 | 18 |
19 virtual std::string BuildQuery(const std::string& base, | 19 virtual std::string BuildQuery(const std::string& base, |
20 const std::string& test_case) = 0; | 20 const std::string& test_case) = 0; |
21 | 21 |
22 // Returns the URL to load for file: tests. | 22 // Returns the URL to load for file: tests. |
23 GURL GetTestFileUrl(const std::string& test_case); | 23 GURL GetTestFileUrl(const std::string& test_case); |
24 void RunTest(const std::string& test_case); | 24 void RunTest(const std::string& test_case); |
25 // Run the test and reload. This can test for clean shutdown, including leaked | 25 // Run the test and reload. This can test for clean shutdown, including leaked |
26 // instance object vars. | 26 // instance object vars. |
27 void RunTestAndReload(const std::string& test_case); | 27 void RunTestAndReload(const std::string& test_case); |
28 void RunTestViaHTTP(const std::string& test_case); | 28 void RunTestViaHTTP(const std::string& test_case); |
| 29 void RunTestWithSSLServer(const std::string& test_case); |
29 void RunTestWithWebSocketServer(const std::string& test_case); | 30 void RunTestWithWebSocketServer(const std::string& test_case); |
30 std::string StripPrefixes(const std::string& test_name); | 31 std::string StripPrefixes(const std::string& test_name); |
31 | 32 |
32 protected: | 33 protected: |
33 // Runs the test for a tab given the tab that's already navigated to the | 34 // Runs the test for a tab given the tab that's already navigated to the |
34 // given URL. | 35 // given URL. |
35 void RunTestURL(const GURL& test_url); | 36 void RunTestURL(const GURL& test_url); |
| 37 // Run the given |test_case| on a HTTP test server whose document root is |
| 38 // specified by |document_root|. |extra_params| will be passed as URL |
| 39 // parameters to the test. |
| 40 void RunHTTPTestServer(const FilePath& document_root, |
| 41 const std::string& test_case, |
| 42 const std::string& extra_params); |
| 43 // Return the document root for the HTTP server on which tests will be run. |
| 44 // The result is placed in |document_root|. False is returned upon failure. |
| 45 bool GetHTTPDocumentRoot(FilePath* document_root); |
36 }; | 46 }; |
37 | 47 |
38 // In-process plugin test runner. See OutOfProcessPPAPITest below for the | 48 // In-process plugin test runner. See OutOfProcessPPAPITest below for the |
39 // out-of-process version. | 49 // out-of-process version. |
40 class PPAPITest : public PPAPITestBase { | 50 class PPAPITest : public PPAPITestBase { |
41 public: | 51 public: |
42 PPAPITest(); | 52 PPAPITest(); |
43 | 53 |
44 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; | 54 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; |
45 | 55 |
(...skipping 25 matching lines...) Expand all Loading... |
71 public: | 81 public: |
72 PPAPINaClTestDisallowedSockets(); | 82 PPAPINaClTestDisallowedSockets(); |
73 | 83 |
74 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; | 84 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; |
75 | 85 |
76 virtual std::string BuildQuery(const std::string& base, | 86 virtual std::string BuildQuery(const std::string& base, |
77 const std::string& test_case) OVERRIDE; | 87 const std::string& test_case) OVERRIDE; |
78 }; | 88 }; |
79 | 89 |
80 #endif // CHROME_TEST_UI_PPAPI_UITEST_H_ | 90 #endif // CHROME_TEST_UI_PPAPI_UITEST_H_ |
OLD | NEW |