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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 class NaClBrowserTestPnacl : public NaClBrowserTestBase { | 119 class NaClBrowserTestPnacl : public NaClBrowserTestBase { |
120 public: | 120 public: |
121 virtual base::FilePath::StringType Variant() OVERRIDE; | 121 virtual base::FilePath::StringType Variant() OVERRIDE; |
122 | 122 |
123 virtual bool IsAPnaclTest() OVERRIDE; | 123 virtual bool IsAPnaclTest() OVERRIDE; |
124 }; | 124 }; |
125 | 125 |
126 class NaClBrowserTestPnaclNonSfi : public NaClBrowserTestBase { | 126 class NaClBrowserTestPnaclNonSfi : public NaClBrowserTestBase { |
127 public: | 127 public: |
| 128 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; |
128 virtual base::FilePath::StringType Variant() OVERRIDE; | 129 virtual base::FilePath::StringType Variant() OVERRIDE; |
129 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; | |
130 }; | 130 }; |
131 | 131 |
132 // Class used to test that when --disable-pnacl is specified the PNaCl mime | 132 // Class used to test that when --disable-pnacl is specified the PNaCl mime |
133 // type is not available. | 133 // type is not available. |
134 class NaClBrowserTestPnaclDisabled : public NaClBrowserTestBase { | 134 class NaClBrowserTestPnaclDisabled : public NaClBrowserTestBase { |
135 public: | 135 public: |
136 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; | 136 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; |
137 | 137 |
138 virtual base::FilePath::StringType Variant() OVERRIDE; | 138 virtual base::FilePath::StringType Variant() OVERRIDE; |
139 | 139 |
(...skipping 17 matching lines...) Expand all Loading... |
157 | 157 |
158 // PNaCl tests take a long time on windows debug builds | 158 // PNaCl tests take a long time on windows debug builds |
159 // and sometimes time out. Disable until it is made faster: | 159 // and sometimes time out. Disable until it is made faster: |
160 // https://code.google.com/p/chromium/issues/detail?id=177555 | 160 // https://code.google.com/p/chromium/issues/detail?id=177555 |
161 #if (defined(OS_WIN) && !defined(NDEBUG)) | 161 #if (defined(OS_WIN) && !defined(NDEBUG)) |
162 #define MAYBE_PNACL(test_name) DISABLED_##test_name | 162 #define MAYBE_PNACL(test_name) DISABLED_##test_name |
163 #else | 163 #else |
164 #define MAYBE_PNACL(test_name) test_name | 164 #define MAYBE_PNACL(test_name) test_name |
165 #endif | 165 #endif |
166 | 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 |
167 #if defined(ARCH_CPU_ARM_FAMILY) || defined(ARCH_CPU_MIPS_FAMILY) | 182 #if defined(ARCH_CPU_ARM_FAMILY) || defined(ARCH_CPU_MIPS_FAMILY) |
168 | 183 |
169 // There is no support for Glibc on ARM and MIPS NaCl. | 184 // There is no support for Glibc on ARM and MIPS NaCl. |
170 #define NACL_BROWSER_TEST_F(suite, name, body) \ | 185 #define NACL_BROWSER_TEST_F(suite, name, body) \ |
171 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ | 186 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ |
172 body \ | 187 body \ |
173 IN_PROC_BROWSER_TEST_F(suite##Pnacl, MAYBE_PNACL(name)) \ | 188 IN_PROC_BROWSER_TEST_F(suite##Pnacl, MAYBE_PNACL(name)) \ |
174 body | 189 body |
175 | 190 |
176 #else | 191 #else |
177 | 192 |
178 // Otherwise, we have Glibc, Newlib and Pnacl tests | 193 // Otherwise, we have Glibc, Newlib and Pnacl tests |
179 #define NACL_BROWSER_TEST_F(suite, name, body) \ | 194 #define NACL_BROWSER_TEST_F(suite, name, body) \ |
180 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ | 195 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ |
181 body \ | 196 body \ |
182 IN_PROC_BROWSER_TEST_F(suite##GLibc, name) \ | 197 IN_PROC_BROWSER_TEST_F(suite##GLibc, name) \ |
183 body \ | 198 body \ |
184 IN_PROC_BROWSER_TEST_F(suite##Pnacl, MAYBE_PNACL(name)) \ | 199 IN_PROC_BROWSER_TEST_F(suite##Pnacl, MAYBE_PNACL(name)) \ |
185 body | 200 body |
186 | 201 |
187 #endif | 202 #endif |
188 | 203 |
189 #endif // CHROME_TEST_NACL_NACL_BROWSERTEST_UTIL_H_ | 204 #endif // CHROME_TEST_NACL_NACL_BROWSERTEST_UTIL_H_ |
OLD | NEW |