Chromium Code Reviews| 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 // "Transitional" here means that, this uses nacl_helper_nonsfi which has | |
|
Mark Seaborn
2014/11/19 06:23:54
Grammar nit: remove comma after "that"
hidehiko
2014/11/19 18:48:51
Done.
| |
| 133 // nacl_helper feature for Non-SFI mode, but statically linked to newlib | |
| 134 // instead of using host glibc. It is still under development. | |
| 135 // TODO(hidehiko): Switch for NonSfi tests to use nacl_helper_nonsfi, when | |
|
Mark Seaborn
2014/11/19 06:23:54
Nit: "Switch for" -> "Switch"? Same below...
hidehiko
2014/11/19 18:48:50
Done.
| |
| 136 // it is launched officially. | |
| 137 class NaClBrowserTestPnaclTransitionalNonSfi | |
| 138 : public NaClBrowserTestPnaclNonSfi { | |
| 139 public: | |
| 140 void SetUpCommandLine(base::CommandLine* command_line) override; | |
| 141 }; | |
| 142 | |
| 132 class NaClBrowserTestNonSfiMode : public NaClBrowserTestBase { | 143 class NaClBrowserTestNonSfiMode : public NaClBrowserTestBase { |
| 133 public: | 144 public: |
| 134 void SetUpCommandLine(base::CommandLine* command_line) override; | 145 void SetUpCommandLine(base::CommandLine* command_line) override; |
| 135 base::FilePath::StringType Variant() override; | 146 base::FilePath::StringType Variant() override; |
| 136 }; | 147 }; |
| 137 | 148 |
| 149 // TODO(hidehiko): Switch for NonSfi tests to use nacl_helper_nonsfi, when | |
| 150 // it is launched officially. See NaClBrowserTestPnaclTransitionalNonSfi | |
| 151 // for more details. | |
| 152 class NaClBrowserTestTransitionalNonSfi : public NaClBrowserTestNonSfiMode { | |
| 153 public: | |
| 154 void SetUpCommandLine(base::CommandLine* command_line) override; | |
| 155 }; | |
| 156 | |
| 138 // A NaCl browser test only using static files. | 157 // A NaCl browser test only using static files. |
| 139 class NaClBrowserTestStatic : public NaClBrowserTestBase { | 158 class NaClBrowserTestStatic : public NaClBrowserTestBase { |
| 140 public: | 159 public: |
| 141 base::FilePath::StringType Variant() override; | 160 base::FilePath::StringType Variant() override; |
| 142 bool GetDocumentRoot(base::FilePath* document_root) override; | 161 bool GetDocumentRoot(base::FilePath* document_root) override; |
| 143 }; | 162 }; |
| 144 | 163 |
| 145 // A NaCl browser test that loads from an unpacked chrome extension. | 164 // A NaCl browser test that loads from an unpacked chrome extension. |
| 146 // The directory of the unpacked extension files is determined by | 165 // The directory of the unpacked extension files is determined by |
| 147 // the tester's document root. | 166 // the tester's document root. |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 174 | 193 |
| 175 // Sanitizers internally use some syscalls which non-SFI NaCl disallows. | 194 // Sanitizers internally use some syscalls which non-SFI NaCl disallows. |
| 176 #if defined(OS_LINUX) && !defined(ADDRESS_SANITIZER) && \ | 195 #if defined(OS_LINUX) && !defined(ADDRESS_SANITIZER) && \ |
| 177 !defined(THREAD_SANITIZER) && !defined(MEMORY_SANITIZER) && \ | 196 !defined(THREAD_SANITIZER) && !defined(MEMORY_SANITIZER) && \ |
| 178 !defined(LEAK_SANITIZER) | 197 !defined(LEAK_SANITIZER) |
| 179 # define MAYBE_NONSFI(test_case) test_case | 198 # define MAYBE_NONSFI(test_case) test_case |
| 180 #else | 199 #else |
| 181 # define MAYBE_NONSFI(test_case) DISABLED_##test_case | 200 # define MAYBE_NONSFI(test_case) DISABLED_##test_case |
| 182 #endif | 201 #endif |
| 183 | 202 |
| 203 // Currently, we only supports it on x86-32 architecture. | |
|
Mark Seaborn
2014/11/19 06:23:54
"only support"
hidehiko
2014/11/19 18:48:51
Done.
| |
| 204 // TODO(hidehiko,mazda): Enable this on ARM, too, when it is supported. | |
| 205 #if defined(OS_LINUX) && !defined(ADDRESS_SANITIZER) && \ | |
| 206 !defined(THREAD_SANITIZER) && !defined(MEMORY_SANITIZER) && \ | |
| 207 !defined(LEAK_SANITIZER) && defined(ARCH_CPU_X86) | |
| 208 # define MAYBE_NACL_HELPER_NONSFI(test_case) test_case | |
|
Mark Seaborn
2014/11/19 06:23:54
How about naming these #defines as "TRANSITIONAL"
hidehiko
2014/11/19 18:48:51
Done.
| |
| 209 #else | |
| 210 # define MAYBE_NACL_HELPER_NONSFI(test_case) DISABLED_##test_case | |
| 211 #endif | |
| 212 | |
| 184 // Currently, translation from pexe to non-sfi nexe is supported only for | 213 // Currently, translation from pexe to non-sfi nexe is supported only for |
| 185 // x86-32 or ARM binary. | 214 // x86-32 or ARM binary. |
| 186 #if defined(OS_LINUX) && (defined(ARCH_CPU_X86) || defined(ARCH_CPU_ARMEL)) | 215 #if defined(OS_LINUX) && (defined(ARCH_CPU_X86) || defined(ARCH_CPU_ARMEL)) |
| 187 # define MAYBE_PNACL_NONSFI(test_case) test_case | 216 # define MAYBE_PNACL_NONSFI(test_case) test_case |
| 188 #else | 217 #else |
| 189 # define MAYBE_PNACL_NONSFI(test_case) DISABLED_##test_case | 218 # define MAYBE_PNACL_NONSFI(test_case) DISABLED_##test_case |
| 190 #endif | 219 #endif |
| 191 | 220 |
| 221 // Similar to MAYBE_NACL_HELPER_NONSFI, this is not available on ARM yet. | |
| 222 // TODO(hidehiko,mazda): Merge this to the MAYBE_PNACL_NONSFI when it is | |
| 223 // supported on ARM. | |
| 224 #if defined(OS_LINUX) && defined(ARCH_CPU_X86) | |
| 225 # define MAYBE_PNACL_NACL_HELPER_NONSFI(test_case) test_case | |
| 226 #else | |
| 227 # define MAYBE_PNACL_NACL_HELPER_NONSFI(test_case) DISABLED_##test_case | |
| 228 #endif | |
| 229 | |
| 230 | |
| 192 #define NACL_BROWSER_TEST_F(suite, name, body) \ | 231 #define NACL_BROWSER_TEST_F(suite, name, body) \ |
| 193 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ | 232 IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ |
| 194 body \ | 233 body \ |
| 195 IN_PROC_BROWSER_TEST_F(suite##GLibc, MAYBE_GLIBC(name)) \ | 234 IN_PROC_BROWSER_TEST_F(suite##GLibc, MAYBE_GLIBC(name)) \ |
| 196 body \ | 235 body \ |
| 197 IN_PROC_BROWSER_TEST_F(suite##Pnacl, MAYBE_PNACL(name)) \ | 236 IN_PROC_BROWSER_TEST_F(suite##Pnacl, MAYBE_PNACL(name)) \ |
| 198 body | 237 body |
| 199 | 238 |
| 200 #endif // CHROME_TEST_NACL_NACL_BROWSERTEST_UTIL_H_ | 239 #endif // CHROME_TEST_NACL_NACL_BROWSERTEST_UTIL_H_ |
| OLD | NEW |