| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; | 67 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; |
| 68 | 68 |
| 69 // What variant are we running - newlib, glibc, pnacl, etc? | 69 // What variant are we running - newlib, glibc, pnacl, etc? |
| 70 // This is used to compute what directory we're pulling data from, but it can | 70 // This is used to compute what directory we're pulling data from, but it can |
| 71 // also be used to affect the behavior of the test. | 71 // also be used to affect the behavior of the test. |
| 72 virtual base::FilePath::StringType Variant() = 0; | 72 virtual base::FilePath::StringType Variant() = 0; |
| 73 | 73 |
| 74 // Where are the files for this class of test located on disk? | 74 // Where are the files for this class of test located on disk? |
| 75 virtual bool GetDocumentRoot(base::FilePath* document_root); | 75 virtual bool GetDocumentRoot(base::FilePath* document_root); |
| 76 | 76 |
| 77 virtual bool IsPnacl(); | 77 virtual bool IsAPnaclTest(); |
| 78 |
| 79 virtual bool IsPnaclDisabled(); |
| 78 | 80 |
| 79 // Map a file relative to the variant directory to a URL served by the test | 81 // Map a file relative to the variant directory to a URL served by the test |
| 80 // web server. | 82 // web server. |
| 81 GURL TestURL(const base::FilePath::StringType& url_fragment); | 83 GURL TestURL(const base::FilePath::StringType& url_fragment); |
| 82 | 84 |
| 83 // Load a URL and listen to automation events with a given handler. | 85 // Load a URL and listen to automation events with a given handler. |
| 84 // Returns true if the test glue function correctly. (The handler should | 86 // Returns true if the test glue function correctly. (The handler should |
| 85 // seperately indicate if the test failed.) | 87 // seperately indicate if the test failed.) |
| 86 bool RunJavascriptTest(const GURL& url, TestMessageHandler* handler); | 88 bool RunJavascriptTest(const GURL& url, TestMessageHandler* handler); |
| 87 | 89 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 109 virtual base::FilePath::StringType Variant() OVERRIDE; | 111 virtual base::FilePath::StringType Variant() OVERRIDE; |
| 110 }; | 112 }; |
| 111 | 113 |
| 112 class NaClBrowserTestGLibc : public NaClBrowserTestBase { | 114 class NaClBrowserTestGLibc : public NaClBrowserTestBase { |
| 113 public: | 115 public: |
| 114 virtual base::FilePath::StringType Variant() OVERRIDE; | 116 virtual base::FilePath::StringType Variant() OVERRIDE; |
| 115 }; | 117 }; |
| 116 | 118 |
| 117 class NaClBrowserTestPnacl : public NaClBrowserTestBase { | 119 class NaClBrowserTestPnacl : public NaClBrowserTestBase { |
| 118 public: | 120 public: |
| 121 virtual base::FilePath::StringType Variant() OVERRIDE; |
| 122 |
| 123 virtual bool IsAPnaclTest() OVERRIDE; |
| 124 }; |
| 125 |
| 126 // Class used to test that when --disable-pnacl is specified the PNaCl mime |
| 127 // type is not available. |
| 128 class NaClBrowserTestPnaclDisabled : public NaClBrowserTestBase { |
| 129 public: |
| 119 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; | 130 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; |
| 120 | 131 |
| 121 virtual base::FilePath::StringType Variant() OVERRIDE; | 132 virtual base::FilePath::StringType Variant() OVERRIDE; |
| 122 | 133 |
| 123 virtual bool IsPnacl() OVERRIDE; | 134 virtual bool IsAPnaclTest() OVERRIDE; |
| 135 |
| 136 virtual bool IsPnaclDisabled() OVERRIDE; |
| 124 }; | 137 }; |
| 125 | 138 |
| 126 // Temporary class for running tests with the new cache enabled. Once all the | 139 // Temporary class for running tests with the new cache enabled. Once all the |
| 127 // pieces land, this will go away and the new cache will be on by default. | 140 // pieces land, this will go away and the new cache will be on by default. |
| 128 class NaClBrowserTestPnaclWithNewCache : public NaClBrowserTestPnacl { | 141 class NaClBrowserTestPnaclWithNewCache : public NaClBrowserTestPnacl { |
| 129 public: | 142 public: |
| 130 NaClBrowserTestPnaclWithNewCache(); | 143 NaClBrowserTestPnaclWithNewCache(); |
| 131 }; | 144 }; |
| 132 | 145 |
| 133 // A NaCl browser test only using static files. | 146 // A NaCl browser test only using static files. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 150 | 163 |
| 151 #if defined(ARCH_CPU_ARM_FAMILY) | 164 #if defined(ARCH_CPU_ARM_FAMILY) |
| 152 | 165 |
| 153 // There is no support for Glibc on ARM NaCl. | 166 // There is no support for Glibc on ARM NaCl. |
| 154 #define NACL_BROWSER_TEST_F(suite, name, body) \ | 167 #define NACL_BROWSER_TEST_F(suite, name, body) \ |
| 155 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ | 168 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ |
| 156 body | 169 body |
| 157 | 170 |
| 158 #else | 171 #else |
| 159 | 172 |
| 160 // Otherwise, we have Glibc, Newlib and PNaCl tests | 173 // Otherwise, we have Glibc, Newlib, and Pnacl tests |
| 161 #define NACL_BROWSER_TEST_F(suite, name, body) \ | 174 #define NACL_BROWSER_TEST_F(suite, name, body) \ |
| 162 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ | 175 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ |
| 163 body \ | 176 body \ |
| 164 IN_PROC_BROWSER_TEST_F(suite##GLibc, name) \ | 177 IN_PROC_BROWSER_TEST_F(suite##GLibc, name) \ |
| 165 body \ | 178 body \ |
| 166 IN_PROC_BROWSER_TEST_F(suite##Pnacl, MAYBE_PNACL(name)) \ | 179 IN_PROC_BROWSER_TEST_F(suite##Pnacl, MAYBE_PNACL(name)) \ |
| 167 body | 180 body |
| 168 | 181 |
| 169 #endif | 182 #endif |
| 170 | 183 |
| 171 #endif // CHROME_TEST_NACL_NACL_BROWSERTEST_UTIL_H_ | 184 #endif // CHROME_TEST_NACL_NACL_BROWSERTEST_UTIL_H_ |
| OLD | NEW |