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 <stdlib.h> | 7 #include <stdlib.h> |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } | 192 } |
193 | 193 |
194 NaClBrowserTestBase::~NaClBrowserTestBase() { | 194 NaClBrowserTestBase::~NaClBrowserTestBase() { |
195 } | 195 } |
196 | 196 |
197 void NaClBrowserTestBase::SetUpCommandLine(base::CommandLine* command_line) { | 197 void NaClBrowserTestBase::SetUpCommandLine(base::CommandLine* command_line) { |
198 command_line->AppendSwitch(switches::kEnableNaCl); | 198 command_line->AppendSwitch(switches::kEnableNaCl); |
199 } | 199 } |
200 | 200 |
201 void NaClBrowserTestBase::SetUpOnMainThread() { | 201 void NaClBrowserTestBase::SetUpOnMainThread() { |
202 // Sanity check. | |
203 base::FilePath plugin_lib; | |
204 ASSERT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); | |
205 ASSERT_TRUE(base::PathExists(plugin_lib)) << plugin_lib.value(); | |
206 | |
207 ASSERT_TRUE(StartTestServer()) << "Cannot start test server."; | 202 ASSERT_TRUE(StartTestServer()) << "Cannot start test server."; |
208 } | 203 } |
209 | 204 |
210 bool NaClBrowserTestBase::GetDocumentRoot(base::FilePath* document_root) { | 205 bool NaClBrowserTestBase::GetDocumentRoot(base::FilePath* document_root) { |
211 return GetNaClVariantRoot(Variant(), document_root); | 206 return GetNaClVariantRoot(Variant(), document_root); |
212 } | 207 } |
213 | 208 |
214 bool NaClBrowserTestBase::IsAPnaclTest() { | 209 bool NaClBrowserTestBase::IsAPnaclTest() { |
215 return false; | 210 return false; |
216 } | 211 } |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 // to point at the isolated the test extension directory. | 323 // to point at the isolated the test extension directory. |
329 // Otherwise, multiple NaCl extensions tests will end up sharing the | 324 // Otherwise, multiple NaCl extensions tests will end up sharing the |
330 // same directory when loading the extension files. | 325 // same directory when loading the extension files. |
331 base::FilePath document_root; | 326 base::FilePath document_root; |
332 ASSERT_TRUE(GetDocumentRoot(&document_root)); | 327 ASSERT_TRUE(GetDocumentRoot(&document_root)); |
333 | 328 |
334 // Document root is relative to source root, and source root may not be CWD. | 329 // Document root is relative to source root, and source root may not be CWD. |
335 command_line->AppendSwitchPath(switches::kLoadExtension, | 330 command_line->AppendSwitchPath(switches::kLoadExtension, |
336 src_root.Append(document_root)); | 331 src_root.Append(document_root)); |
337 } | 332 } |
OLD | NEW |