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_PPAPI_PPAPI_TEST_H_ | 5 #ifndef CHROME_TEST_PPAPI_PPAPI_TEST_H_ |
6 #define CHROME_TEST_PPAPI_PPAPI_TEST_H_ | 6 #define CHROME_TEST_PPAPI_PPAPI_TEST_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "chrome/test/base/in_process_browser_test.h" | 13 #include "chrome/test/base/in_process_browser_test.h" |
14 #include "chrome/test/base/javascript_test_observer.h" | 14 #include "chrome/test/base/javascript_test_observer.h" |
| 15 #include "net/test/test_server.h" |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 class RenderViewHost; | 18 class RenderViewHost; |
18 } | 19 } |
19 | 20 |
20 class PPAPITestMessageHandler : public TestMessageHandler { | 21 class PPAPITestMessageHandler : public TestMessageHandler { |
21 public: | 22 public: |
22 PPAPITestMessageHandler(); | 23 PPAPITestMessageHandler(); |
23 | 24 |
24 MessageResponse HandleMessage(const std::string& json); | 25 MessageResponse HandleMessage(const std::string& json); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 void ExpectInfoBarAndAccept(bool should_accept); | 73 void ExpectInfoBarAndAccept(bool should_accept); |
73 | 74 |
74 private: | 75 private: |
75 content::NotificationRegistrar registrar_; | 76 content::NotificationRegistrar registrar_; |
76 std::list<bool> expected_infobars_; | 77 std::list<bool> expected_infobars_; |
77 }; | 78 }; |
78 | 79 |
79 // Runs the test for a tab given the tab that's already navigated to the | 80 // Runs the test for a tab given the tab that's already navigated to the |
80 // given URL. | 81 // given URL. |
81 void RunTestURL(const GURL& test_url); | 82 void RunTestURL(const GURL& test_url); |
82 // Run the given |test_case| on a HTTP test server whose document root is | 83 // Gets the URL of the the given |test_case| for the given HTTP test server. |
83 // specified by |document_root|. |extra_params| will be passed as URL | 84 // If |extra_params| is non-empty, it will be appended as URL parameters. |
84 // parameters to the test. | 85 GURL GetTestURL(const net::TestServer& http_server, |
85 void RunHTTPTestServer(const FilePath& document_root, | 86 const std::string& test_case, |
86 const std::string& test_case, | 87 const std::string& extra_params); |
87 const std::string& extra_params); | 88 |
88 // Return the document root for the HTTP server on which tests will be run. | 89 // Return the document root for the HTTP server on which tests will be run. |
89 // The result is placed in |document_root|. False is returned upon failure. | 90 // The result is placed in |document_root|. False is returned upon failure. |
90 bool GetHTTPDocumentRoot(FilePath* document_root); | 91 bool GetHTTPDocumentRoot(FilePath* document_root); |
91 }; | 92 }; |
92 | 93 |
93 // In-process plugin test runner. See OutOfProcessPPAPITest below for the | 94 // In-process plugin test runner. See OutOfProcessPPAPITest below for the |
94 // out-of-process version. | 95 // out-of-process version. |
95 class PPAPITest : public PPAPITestBase { | 96 class PPAPITest : public PPAPITestBase { |
96 public: | 97 public: |
97 PPAPITest(); | 98 PPAPITest(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 const std::string& test_case) OVERRIDE; | 140 const std::string& test_case) OVERRIDE; |
140 }; | 141 }; |
141 | 142 |
142 class PPAPIBrokerInfoBarTest : public OutOfProcessPPAPITest { | 143 class PPAPIBrokerInfoBarTest : public OutOfProcessPPAPITest { |
143 public: | 144 public: |
144 // PPAPITestBase override: | 145 // PPAPITestBase override: |
145 virtual void SetUpOnMainThread() OVERRIDE; | 146 virtual void SetUpOnMainThread() OVERRIDE; |
146 }; | 147 }; |
147 | 148 |
148 #endif // CHROME_TEST_PPAPI_PPAPI_TEST_H_ | 149 #endif // CHROME_TEST_PPAPI_PPAPI_TEST_H_ |
OLD | NEW |