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 #include "chrome/test/nacl/nacl_browsertest_util.h" | 5 #include "chrome/test/nacl/nacl_browsertest_util.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/environment.h" | |
8 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
9 #include "base/path_service.h" | 10 #include "base/path_service.h" |
10 #include "base/values.h" | 11 #include "base/values.h" |
11 #include "chrome/browser/ui/browser_tabstrip.h" | 12 #include "chrome/browser/ui/browser_tabstrip.h" |
12 #include "chrome/common/chrome_paths.h" | 13 #include "chrome/common/chrome_paths.h" |
13 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
14 #include "chrome/test/base/ui_test_utils.h" | 15 #include "chrome/test/base/ui_test_utils.h" |
15 #include "content/public/browser/plugin_service.h" | 16 #include "content/public/browser/plugin_service.h" |
16 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
17 #include "net/base/net_util.h" | 18 #include "net/base/net_util.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 *document_root = document_root->Append(variant); | 176 *document_root = document_root->Append(variant); |
176 return true; | 177 return true; |
177 } | 178 } |
178 | 179 |
179 NaClBrowserTestBase::NaClBrowserTestBase() { | 180 NaClBrowserTestBase::NaClBrowserTestBase() { |
180 } | 181 } |
181 | 182 |
182 NaClBrowserTestBase::~NaClBrowserTestBase() { | 183 NaClBrowserTestBase::~NaClBrowserTestBase() { |
183 } | 184 } |
184 | 185 |
186 void NaClBrowserTestBase::SetUp() { | |
187 #if defined(ADDRESS_SANITIZER) | |
188 base::Environment* env = base::Environment::Create(); | |
189 env->SetVar("NACL_DANGEROUS_SKIP_QUALIFICATION_TEST", "1"); | |
Mark Seaborn
2013/01/29 17:37:26
Shouldn't you also unset this env var for the next
| |
190 #endif | |
191 InProcessBrowserTest::SetUp(); | |
192 } | |
193 | |
185 void NaClBrowserTestBase::SetUpCommandLine(CommandLine* command_line) { | 194 void NaClBrowserTestBase::SetUpCommandLine(CommandLine* command_line) { |
186 command_line->AppendSwitch(switches::kNoFirstRun); | 195 command_line->AppendSwitch(switches::kNoFirstRun); |
187 command_line->AppendSwitch(switches::kEnableNaCl); | 196 command_line->AppendSwitch(switches::kEnableNaCl); |
188 } | 197 } |
189 | 198 |
190 void NaClBrowserTestBase::SetUpInProcessBrowserTestFixture() { | 199 void NaClBrowserTestBase::SetUpInProcessBrowserTestFixture() { |
191 // Sanity check. | 200 // Sanity check. |
192 FilePath plugin_lib; | 201 FilePath plugin_lib; |
193 ASSERT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); | 202 ASSERT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); |
194 ASSERT_TRUE(file_util::PathExists(plugin_lib)) << plugin_lib.value(); | 203 ASSERT_TRUE(file_util::PathExists(plugin_lib)) << plugin_lib.value(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
254 } | 263 } |
255 | 264 |
256 bool NaClBrowserTestPnacl::IsPnacl() { | 265 bool NaClBrowserTestPnacl::IsPnacl() { |
257 return true; | 266 return true; |
258 } | 267 } |
259 | 268 |
260 void NaClBrowserTestPnacl::SetUpCommandLine(CommandLine* command_line) { | 269 void NaClBrowserTestPnacl::SetUpCommandLine(CommandLine* command_line) { |
261 NaClBrowserTestBase::SetUpCommandLine(command_line); | 270 NaClBrowserTestBase::SetUpCommandLine(command_line); |
262 command_line->AppendSwitch(switches::kEnablePnacl); | 271 command_line->AppendSwitch(switches::kEnablePnacl); |
263 } | 272 } |
OLD | NEW |