| 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_NACL_NACL_BROWSERTEST_UTIL_H_ | 5 #ifndef CHROME_TEST_NACL_NACL_BROWSERTEST_UTIL_H_ |
| 6 #define CHROME_TEST_NACL_NACL_BROWSERTEST_UTIL_H_ | 6 #define CHROME_TEST_NACL_NACL_BROWSERTEST_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // setting up other tests, such as checking that UMA data was logged. | 91 // setting up other tests, such as checking that UMA data was logged. |
| 92 void RunLoadTest(const base::FilePath::StringType& test_file); | 92 void RunLoadTest(const base::FilePath::StringType& test_file); |
| 93 | 93 |
| 94 // Run a test that was originally written to use NaCl's integration testing | 94 // Run a test that was originally written to use NaCl's integration testing |
| 95 // jig. These tests were originally driven by NaCl's SCons build in the | 95 // jig. These tests were originally driven by NaCl's SCons build in the |
| 96 // nacl_integration test stage on the Chrome waterfall. Changes in the | 96 // nacl_integration test stage on the Chrome waterfall. Changes in the |
| 97 // boundaries between the Chrome and NaCl repos have resulted in many of | 97 // boundaries between the Chrome and NaCl repos have resulted in many of |
| 98 // these tests having a stronger affinity with the Chrome repo. This method | 98 // these tests having a stronger affinity with the Chrome repo. This method |
| 99 // provides a compatibility layer to simplify turning nacl_integration tests | 99 // provides a compatibility layer to simplify turning nacl_integration tests |
| 100 // into browser tests. | 100 // into browser tests. |
| 101 void RunNaClIntegrationTest(const base::FilePath::StringType& url_fragment); | 101 // |full_url| is true if the full URL is given, otherwise it is a |
| 102 // relative URL. |
| 103 void RunNaClIntegrationTest(const base::FilePath::StringType& url, |
| 104 bool full_url = false); |
| 102 | 105 |
| 103 private: | 106 private: |
| 104 bool StartTestServer(); | 107 bool StartTestServer(); |
| 105 | 108 |
| 106 scoped_ptr<net::SpawnedTestServer> test_server_; | 109 scoped_ptr<net::SpawnedTestServer> test_server_; |
| 107 }; | 110 }; |
| 108 | 111 |
| 109 class NaClBrowserTestNewlib : public NaClBrowserTestBase { | 112 class NaClBrowserTestNewlib : public NaClBrowserTestBase { |
| 110 public: | 113 public: |
| 111 virtual base::FilePath::StringType Variant() OVERRIDE; | 114 virtual base::FilePath::StringType Variant() OVERRIDE; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 virtual base::FilePath::StringType Variant() OVERRIDE; | 151 virtual base::FilePath::StringType Variant() OVERRIDE; |
| 149 }; | 152 }; |
| 150 | 153 |
| 151 // A NaCl browser test only using static files. | 154 // A NaCl browser test only using static files. |
| 152 class NaClBrowserTestStatic : public NaClBrowserTestBase { | 155 class NaClBrowserTestStatic : public NaClBrowserTestBase { |
| 153 public: | 156 public: |
| 154 virtual base::FilePath::StringType Variant() OVERRIDE; | 157 virtual base::FilePath::StringType Variant() OVERRIDE; |
| 155 virtual bool GetDocumentRoot(base::FilePath* document_root) OVERRIDE; | 158 virtual bool GetDocumentRoot(base::FilePath* document_root) OVERRIDE; |
| 156 }; | 159 }; |
| 157 | 160 |
| 161 // A NaCl browser test that loads from an unpacked chrome extension. |
| 162 // The directory of the unpacked extension files is determined by |
| 163 // the tester's document root. |
| 164 class NaClBrowserTestNewlibExtension : public NaClBrowserTestNewlib { |
| 165 public: |
| 166 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; |
| 167 }; |
| 168 |
| 158 // PNaCl tests take a long time on windows debug builds | 169 // PNaCl tests take a long time on windows debug builds |
| 159 // and sometimes time out. Disable until it is made faster: | 170 // and sometimes time out. Disable until it is made faster: |
| 160 // https://code.google.com/p/chromium/issues/detail?id=177555 | 171 // https://code.google.com/p/chromium/issues/detail?id=177555 |
| 161 #if (defined(OS_WIN) && !defined(NDEBUG)) | 172 #if (defined(OS_WIN) && !defined(NDEBUG)) |
| 162 # define MAYBE_PNACL(test_name) DISABLED_##test_name | 173 # define MAYBE_PNACL(test_name) DISABLED_##test_name |
| 163 #else | 174 #else |
| 164 # define MAYBE_PNACL(test_name) test_name | 175 # define MAYBE_PNACL(test_name) test_name |
| 165 #endif | 176 #endif |
| 166 | 177 |
| 167 // NaCl glibc tests are included for x86 only, as there is no glibc support | 178 // NaCl glibc tests are included for x86 only, as there is no glibc support |
| (...skipping 21 matching lines...) Expand all Loading... |
| 189 | 200 |
| 190 #define NACL_BROWSER_TEST_F(suite, name, body) \ | 201 #define NACL_BROWSER_TEST_F(suite, name, body) \ |
| 191 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ | 202 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ |
| 192 body \ | 203 body \ |
| 193 IN_PROC_BROWSER_TEST_F(suite##GLibc, MAYBE_GLIBC(name)) \ | 204 IN_PROC_BROWSER_TEST_F(suite##GLibc, MAYBE_GLIBC(name)) \ |
| 194 body \ | 205 body \ |
| 195 IN_PROC_BROWSER_TEST_F(suite##Pnacl, MAYBE_PNACL(name)) \ | 206 IN_PROC_BROWSER_TEST_F(suite##Pnacl, MAYBE_PNACL(name)) \ |
| 196 body | 207 body |
| 197 | 208 |
| 198 #endif // CHROME_TEST_NACL_NACL_BROWSERTEST_UTIL_H_ | 209 #endif // CHROME_TEST_NACL_NACL_BROWSERTEST_UTIL_H_ |
| OLD | NEW |