Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1898)

Side by Side Diff: chrome/test/nacl/nacl_browsertest_util.h

Issue 249183004: Implement open_resource in non-SFI mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 virtual base::FilePath::StringType Variant() OVERRIDE; 116 virtual base::FilePath::StringType Variant() OVERRIDE;
117 }; 117 };
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 {
127 public:
128 virtual base::FilePath::StringType Variant() OVERRIDE;
129 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE;
130 };
131
132 // Class used to test that when --disable-pnacl is specified the PNaCl mime 126 // Class used to test that when --disable-pnacl is specified the PNaCl mime
133 // type is not available. 127 // type is not available.
134 class NaClBrowserTestPnaclDisabled : public NaClBrowserTestBase { 128 class NaClBrowserTestPnaclDisabled : public NaClBrowserTestBase {
135 public: 129 public:
136 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; 130 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE;
137 131
138 virtual base::FilePath::StringType Variant() OVERRIDE; 132 virtual base::FilePath::StringType Variant() OVERRIDE;
139 133
140 virtual bool IsAPnaclTest() OVERRIDE; 134 virtual bool IsAPnaclTest() OVERRIDE;
141 135
142 virtual bool IsPnaclDisabled() OVERRIDE; 136 virtual bool IsPnaclDisabled() OVERRIDE;
143 }; 137 };
144 138
145 class NaClBrowserTestNonSfiMode : public NaClBrowserTestBase { 139 class NaClBrowserTestNonSfiMode : public NaClBrowserTestBase {
146 public: 140 public:
147 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; 141 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE;
148 virtual base::FilePath::StringType Variant() OVERRIDE; 142 virtual base::FilePath::StringType Variant() OVERRIDE;
149 }; 143 };
150 144
145 class NaClBrowserTestPnaclNonSfi : public NaClBrowserTestBase {
Mark Seaborn 2014/05/01 23:28:33 No need to move this declaration.
hidehiko 2014/05/02 01:32:27 Oh, reverted.
146 public:
147 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE;
148 virtual base::FilePath::StringType Variant() OVERRIDE;
149 };
150
151 // A NaCl browser test only using static files. 151 // A NaCl browser test only using static files.
152 class NaClBrowserTestStatic : public NaClBrowserTestBase { 152 class NaClBrowserTestStatic : public NaClBrowserTestBase {
153 public: 153 public:
154 virtual base::FilePath::StringType Variant() OVERRIDE; 154 virtual base::FilePath::StringType Variant() OVERRIDE;
155 virtual bool GetDocumentRoot(base::FilePath* document_root) OVERRIDE; 155 virtual bool GetDocumentRoot(base::FilePath* document_root) OVERRIDE;
156 }; 156 };
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698