| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 135 |
| 136 virtual bool IsPnaclDisabled() OVERRIDE; | 136 virtual bool IsPnaclDisabled() OVERRIDE; |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 class NaClBrowserTestNonSfiMode : public NaClBrowserTestBase { | 139 class NaClBrowserTestNonSfiMode : public NaClBrowserTestBase { |
| 140 public: | 140 public: |
| 141 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; | 141 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; |
| 142 virtual base::FilePath::StringType Variant() OVERRIDE; | 142 virtual base::FilePath::StringType Variant() OVERRIDE; |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 class NaClBrowserTestPnaclNonSfi : public NaClBrowserTestBase { |
| 146 public: |
| 147 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; |
| 148 virtual base::FilePath::StringType Variant() OVERRIDE; |
| 149 }; |
| 150 |
| 145 // A NaCl browser test only using static files. | 151 // A NaCl browser test only using static files. |
| 146 class NaClBrowserTestStatic : public NaClBrowserTestBase { | 152 class NaClBrowserTestStatic : public NaClBrowserTestBase { |
| 147 public: | 153 public: |
| 148 virtual base::FilePath::StringType Variant() OVERRIDE; | 154 virtual base::FilePath::StringType Variant() OVERRIDE; |
| 149 virtual bool GetDocumentRoot(base::FilePath* document_root) OVERRIDE; | 155 virtual bool GetDocumentRoot(base::FilePath* document_root) OVERRIDE; |
| 150 }; | 156 }; |
| 151 | 157 |
| 152 // PNaCl tests take a long time on windows debug builds | 158 // PNaCl tests take a long time on windows debug builds |
| 153 // and sometimes time out. Disable until it is made faster: | 159 // and sometimes time out. Disable until it is made faster: |
| 154 // https://code.google.com/p/chromium/issues/detail?id=177555 | 160 // https://code.google.com/p/chromium/issues/detail?id=177555 |
| 155 #if (defined(OS_WIN) && !defined(NDEBUG)) | 161 #if (defined(OS_WIN) && !defined(NDEBUG)) |
| 156 #define MAYBE_PNACL(test_name) DISABLED_##test_name | 162 #define MAYBE_PNACL(test_name) DISABLED_##test_name |
| 157 #else | 163 #else |
| 158 #define MAYBE_PNACL(test_name) test_name | 164 #define MAYBE_PNACL(test_name) test_name |
| 159 #endif | 165 #endif |
| 160 | 166 |
| 167 // ASan does not work with libc-free context, so disable the test. |
| 168 #if defined(OS_LINUX) && !defined(ADDRESS_SANITIZER) |
| 169 # define MAYBE_NONSFI(test_case) test_case |
| 170 #else |
| 171 # define MAYBE_NONSFI(test_case) DISABLED_##test_case |
| 172 #endif |
| 173 |
| 174 // Currently, translation from pexe to non-sfi nexe is supported only for |
| 175 // x86-32 binary. |
| 176 #if defined(OS_LINUX) && defined(ARCH_CPU_X86) |
| 177 # define MAYBE_PNACL_NONSFI(test_case) test_case |
| 178 #else |
| 179 # define MAYBE_PNACL_NONSFI(test_case) DISABLED_##test_case |
| 180 #endif |
| 181 |
| 161 #if defined(ARCH_CPU_ARM_FAMILY) || defined(ARCH_CPU_MIPS_FAMILY) | 182 #if defined(ARCH_CPU_ARM_FAMILY) || defined(ARCH_CPU_MIPS_FAMILY) |
| 162 | 183 |
| 163 // There is no support for Glibc on ARM and MIPS NaCl. | 184 // There is no support for Glibc on ARM and MIPS NaCl. |
| 164 #define NACL_BROWSER_TEST_F(suite, name, body) \ | 185 #define NACL_BROWSER_TEST_F(suite, name, body) \ |
| 165 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ | 186 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ |
| 166 body \ | 187 body \ |
| 167 IN_PROC_BROWSER_TEST_F(suite##Pnacl, MAYBE_PNACL(name)) \ | 188 IN_PROC_BROWSER_TEST_F(suite##Pnacl, MAYBE_PNACL(name)) \ |
| 168 body | 189 body |
| 169 | 190 |
| 170 #else | 191 #else |
| 171 | 192 |
| 172 // Otherwise, we have Glibc, Newlib and Pnacl tests | 193 // Otherwise, we have Glibc, Newlib and Pnacl tests |
| 173 #define NACL_BROWSER_TEST_F(suite, name, body) \ | 194 #define NACL_BROWSER_TEST_F(suite, name, body) \ |
| 174 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ | 195 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ |
| 175 body \ | 196 body \ |
| 176 IN_PROC_BROWSER_TEST_F(suite##GLibc, name) \ | 197 IN_PROC_BROWSER_TEST_F(suite##GLibc, name) \ |
| 177 body \ | 198 body \ |
| 178 IN_PROC_BROWSER_TEST_F(suite##Pnacl, MAYBE_PNACL(name)) \ | 199 IN_PROC_BROWSER_TEST_F(suite##Pnacl, MAYBE_PNACL(name)) \ |
| 179 body | 200 body |
| 180 | 201 |
| 181 #endif | 202 #endif |
| 182 | 203 |
| 183 #endif // CHROME_TEST_NACL_NACL_BROWSERTEST_UTIL_H_ | 204 #endif // CHROME_TEST_NACL_NACL_BROWSERTEST_UTIL_H_ |
| OLD | NEW |