| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // Run the given |test_case| on a HTTP test server whose document root is |
| 83 // specified by |document_root|. |extra_params| will be passed as URL | 84 // specified by |document_root|. |extra_params| will be passed as URL |
| 84 // parameters to the test. | 85 // parameters to the test. If |extra_server| is valid, we will wait on it to |
| 86 // start before runnint the test. This is for cases where we need an |
| 87 // additional server, such as a WebSockets server, so that we can start the |
| 88 // two servers up in parallel. |
| 85 void RunHTTPTestServer(const FilePath& document_root, | 89 void RunHTTPTestServer(const FilePath& document_root, |
| 86 const std::string& test_case, | 90 const std::string& test_case, |
| 87 const std::string& extra_params); | 91 const std::string& extra_params, |
| 92 net::TestServer* extra_server); |
| 88 // Return the document root for the HTTP server on which tests will be run. | 93 // 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. | 94 // The result is placed in |document_root|. False is returned upon failure. |
| 90 bool GetHTTPDocumentRoot(FilePath* document_root); | 95 bool GetHTTPDocumentRoot(FilePath* document_root); |
| 91 }; | 96 }; |
| 92 | 97 |
| 93 // In-process plugin test runner. See OutOfProcessPPAPITest below for the | 98 // In-process plugin test runner. See OutOfProcessPPAPITest below for the |
| 94 // out-of-process version. | 99 // out-of-process version. |
| 95 class PPAPITest : public PPAPITestBase { | 100 class PPAPITest : public PPAPITestBase { |
| 96 public: | 101 public: |
| 97 PPAPITest(); | 102 PPAPITest(); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 const std::string& test_case) OVERRIDE; | 144 const std::string& test_case) OVERRIDE; |
| 140 }; | 145 }; |
| 141 | 146 |
| 142 class PPAPIBrokerInfoBarTest : public OutOfProcessPPAPITest { | 147 class PPAPIBrokerInfoBarTest : public OutOfProcessPPAPITest { |
| 143 public: | 148 public: |
| 144 // PPAPITestBase override: | 149 // PPAPITestBase override: |
| 145 virtual void SetUpOnMainThread() OVERRIDE; | 150 virtual void SetUpOnMainThread() OVERRIDE; |
| 146 }; | 151 }; |
| 147 | 152 |
| 148 #endif // CHROME_TEST_PPAPI_PPAPI_TEST_H_ | 153 #endif // CHROME_TEST_PPAPI_PPAPI_TEST_H_ |
| OLD | NEW |