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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 | 122 |
123 bool IsAPnaclTest() override; | 123 bool IsAPnaclTest() override; |
124 }; | 124 }; |
125 | 125 |
126 class NaClBrowserTestPnaclNonSfi : public NaClBrowserTestBase { | 126 class NaClBrowserTestPnaclNonSfi : public NaClBrowserTestBase { |
127 public: | 127 public: |
128 void SetUpCommandLine(base::CommandLine* command_line) override; | 128 void SetUpCommandLine(base::CommandLine* command_line) override; |
129 base::FilePath::StringType Variant() override; | 129 base::FilePath::StringType Variant() override; |
130 }; | 130 }; |
131 | 131 |
132 class NaClBrowserTestPnaclNaClHelperNonSfi | |
133 : public NaClBrowserTestPnaclNonSfi { | |
134 public: | |
135 void SetUpCommandLine(base::CommandLine* command_line) override; | |
136 }; | |
137 | |
132 class NaClBrowserTestNonSfiMode : public NaClBrowserTestBase { | 138 class NaClBrowserTestNonSfiMode : public NaClBrowserTestBase { |
133 public: | 139 public: |
134 void SetUpCommandLine(base::CommandLine* command_line) override; | 140 void SetUpCommandLine(base::CommandLine* command_line) override; |
135 base::FilePath::StringType Variant() override; | 141 base::FilePath::StringType Variant() override; |
136 }; | 142 }; |
137 | 143 |
144 class NaClBrowserTestNaClHelperNonSfi : public NaClBrowserTestNonSfiMode { | |
145 public: | |
146 void SetUpCommandLine(base::CommandLine* command_line) override; | |
147 }; | |
148 | |
138 // A NaCl browser test only using static files. | 149 // A NaCl browser test only using static files. |
139 class NaClBrowserTestStatic : public NaClBrowserTestBase { | 150 class NaClBrowserTestStatic : public NaClBrowserTestBase { |
140 public: | 151 public: |
141 base::FilePath::StringType Variant() override; | 152 base::FilePath::StringType Variant() override; |
142 bool GetDocumentRoot(base::FilePath* document_root) override; | 153 bool GetDocumentRoot(base::FilePath* document_root) override; |
143 }; | 154 }; |
144 | 155 |
145 // A NaCl browser test that loads from an unpacked chrome extension. | 156 // A NaCl browser test that loads from an unpacked chrome extension. |
146 // The directory of the unpacked extension files is determined by | 157 // The directory of the unpacked extension files is determined by |
147 // the tester's document root. | 158 // the tester's document root. |
(...skipping 26 matching lines...) Expand all Loading... | |
174 | 185 |
175 // Sanitizers internally use some syscalls which non-SFI NaCl disallows. | 186 // Sanitizers internally use some syscalls which non-SFI NaCl disallows. |
176 #if defined(OS_LINUX) && !defined(ADDRESS_SANITIZER) && \ | 187 #if defined(OS_LINUX) && !defined(ADDRESS_SANITIZER) && \ |
177 !defined(THREAD_SANITIZER) && !defined(MEMORY_SANITIZER) && \ | 188 !defined(THREAD_SANITIZER) && !defined(MEMORY_SANITIZER) && \ |
178 !defined(LEAK_SANITIZER) | 189 !defined(LEAK_SANITIZER) |
179 # define MAYBE_NONSFI(test_case) test_case | 190 # define MAYBE_NONSFI(test_case) test_case |
180 #else | 191 #else |
181 # define MAYBE_NONSFI(test_case) DISABLED_##test_case | 192 # define MAYBE_NONSFI(test_case) DISABLED_##test_case |
182 #endif | 193 #endif |
183 | 194 |
195 // Currently, we only supports it on x86-32 architecture. | |
196 // TODO(hidehiko,mazda): Enable this on ARM, too, when it is supported. | |
197 #if defined(OS_LINUX) && !defined(ADDRESS_SANITIZER) && \ | |
198 !defined(THREAD_SANITIZER) && !defined(MEMORY_SANITIZER) && \ | |
199 !defined(LEAK_SANITIZER) && defined(ARCH_CPU_X86) | |
200 # define MAYBE_NACL_HELPER_NONSFI(test_case) test_case | |
201 #else | |
202 # define MAYBE_NACL_HELPER_NONSFI(test_case) DISABLED_##test_case | |
203 #endif | |
204 | |
184 // Currently, translation from pexe to non-sfi nexe is supported only for | 205 // Currently, translation from pexe to non-sfi nexe is supported only for |
185 // x86-32 or ARM binary. | 206 // x86-32 or ARM binary. |
186 #if defined(OS_LINUX) && (defined(ARCH_CPU_X86) || defined(ARCH_CPU_ARMEL)) | 207 #if defined(OS_LINUX) && (defined(ARCH_CPU_X86) || defined(ARCH_CPU_ARMEL)) |
187 # define MAYBE_PNACL_NONSFI(test_case) test_case | 208 # define MAYBE_PNACL_NONSFI(test_case) test_case |
188 #else | 209 #else |
189 # define MAYBE_PNACL_NONSFI(test_case) DISABLED_##test_case | 210 # define MAYBE_PNACL_NONSFI(test_case) DISABLED_##test_case |
190 #endif | 211 #endif |
191 | 212 |
213 // Similar to MAYBE_NACL_HELPER_NONSFI, this is not available on ARM yet. | |
214 // TODO(hidehiko,mazda): Merge this to the MAYBE_PNACL_NONSFI when it is | |
215 // supported on ARM. | |
216 #if defined(OS_LINUX) && defined(ARCH_CPU_X86) | |
Mark Seaborn
2014/11/17 18:35:19
Shouldn't this be ARCH_CPU_X86_FAMILY so that thes
hidehiko
2014/11/18 04:39:37
Non-SFI testee binaries are built only for ia32 ar
Mark Seaborn
2014/11/19 06:23:54
OK. I assume you'll fix this in a later change?
| |
217 # define MAYBE_PNACL_NACL_HELPER_NONSFI(test_case) test_case | |
218 #else | |
219 # define MAYBE_PNACL_NACL_HELPER_NONSFI(test_case) DISABLED_##test_case | |
220 #endif | |
221 | |
222 | |
192 #define NACL_BROWSER_TEST_F(suite, name, body) \ | 223 #define NACL_BROWSER_TEST_F(suite, name, body) \ |
193 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ | 224 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ |
194 body \ | 225 body \ |
195 IN_PROC_BROWSER_TEST_F(suite##GLibc, MAYBE_GLIBC(name)) \ | 226 IN_PROC_BROWSER_TEST_F(suite##GLibc, MAYBE_GLIBC(name)) \ |
196 body \ | 227 body \ |
197 IN_PROC_BROWSER_TEST_F(suite##Pnacl, MAYBE_PNACL(name)) \ | 228 IN_PROC_BROWSER_TEST_F(suite##Pnacl, MAYBE_PNACL(name)) \ |
198 body | 229 body |
199 | 230 |
200 #endif // CHROME_TEST_NACL_NACL_BROWSERTEST_UTIL_H_ | 231 #endif // CHROME_TEST_NACL_NACL_BROWSERTEST_UTIL_H_ |
OLD | NEW |