OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/extensions/error_console/error_console.h" | 5 #include "chrome/browser/extensions/error_console/error_console.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 profile()->GetPrefs()->SetBoolean(prefs::kExtensionsUIDeveloperMode, true); | 214 profile()->GetPrefs()->SetBoolean(prefs::kExtensionsUIDeveloperMode, true); |
215 | 215 |
216 error_console_ = ErrorConsole::Get(profile()); | 216 error_console_ = ErrorConsole::Get(profile()); |
217 CHECK(error_console_); | 217 CHECK(error_console_); |
218 | 218 |
219 test_data_dir_ = test_data_dir_.AppendASCII("error_console"); | 219 test_data_dir_ = test_data_dir_.AppendASCII("error_console"); |
220 } | 220 } |
221 | 221 |
222 const GURL& GetTestURL() { | 222 const GURL& GetTestURL() { |
223 if (test_url_.is_empty()) { | 223 if (test_url_.is_empty()) { |
224 CHECK(embedded_test_server()->InitializeAndWaitUntilReady()); | 224 CHECK(embedded_test_server()->Start()); |
225 test_url_ = embedded_test_server()->GetURL(kTestingPage); | 225 test_url_ = embedded_test_server()->GetURL(kTestingPage); |
226 } | 226 } |
227 return test_url_; | 227 return test_url_; |
228 } | 228 } |
229 | 229 |
230 // Load the extension at |path|, take the specified |action|, and wait for | 230 // Load the extension at |path|, take the specified |action|, and wait for |
231 // |expected_errors| errors. Populate |extension| with a pointer to the loaded | 231 // |expected_errors| errors. Populate |extension| with a pointer to the loaded |
232 // extension. | 232 // extension. |
233 void LoadExtensionAndCheckErrors( | 233 void LoadExtensionAndCheckErrors( |
234 const std::string& path, | 234 const std::string& path, |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 | 580 |
581 const StackTrace& stack_trace = GetStackTraceFromError(errors[0]); | 581 const StackTrace& stack_trace = GetStackTraceFromError(errors[0]); |
582 ASSERT_EQ(1u, stack_trace.size()); | 582 ASSERT_EQ(1u, stack_trace.size()); |
583 CheckStackFrame(stack_trace[0], | 583 CheckStackFrame(stack_trace[0], |
584 script_url, | 584 script_url, |
585 kAnonymousFunction, | 585 kAnonymousFunction, |
586 12u, 20u); | 586 12u, 20u); |
587 } | 587 } |
588 | 588 |
589 } // namespace extensions | 589 } // namespace extensions |
OLD | NEW |