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/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 std::string(kExtensionScheme) + | 44 std::string(kExtensionScheme) + |
45 content::kStandardSchemeSeparator + | 45 content::kStandardSchemeSeparator + |
46 extension_id); | 46 extension_id); |
47 } | 47 } |
48 | 48 |
49 scoped_ptr<ExtensionError> CreateNewRuntimeError( | 49 scoped_ptr<ExtensionError> CreateNewRuntimeError( |
50 bool from_incognito, | 50 bool from_incognito, |
51 const std::string& extension_id, | 51 const std::string& extension_id, |
52 const string16& message) { | 52 const string16& message) { |
53 return scoped_ptr<ExtensionError>(new RuntimeError( | 53 return scoped_ptr<ExtensionError>(new RuntimeError( |
| 54 extension_id, |
54 from_incognito, | 55 from_incognito, |
55 GetSourceForExtensionId(extension_id), | 56 GetSourceForExtensionId(extension_id), |
56 message, | 57 message, |
57 GetDefaultStackTrace(), | 58 GetDefaultStackTrace(), |
58 GURL::EmptyGURL(), // no context url | 59 GURL::EmptyGURL(), // no context url |
59 logging::LOG_INFO)); | 60 logging::LOG_INFO)); |
60 } | 61 } |
61 | 62 |
62 } // namespace | 63 } // namespace |
63 | 64 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 error_console_->GetErrorsForExtension(kId); | 198 error_console_->GetErrorsForExtension(kId); |
198 ASSERT_EQ(kNumErrors, errors.size()); | 199 ASSERT_EQ(kNumErrors, errors.size()); |
199 | 200 |
200 // The duplicate error should be the last reported (pointer comparison)... | 201 // The duplicate error should be the last reported (pointer comparison)... |
201 ASSERT_EQ(weak_error, errors.back()); | 202 ASSERT_EQ(weak_error, errors.back()); |
202 // ... and should have two reported occurrences. | 203 // ... and should have two reported occurrences. |
203 ASSERT_EQ(2u, errors.back()->occurrences()); | 204 ASSERT_EQ(2u, errors.back()->occurrences()); |
204 } | 205 } |
205 | 206 |
206 } // namespace extensions | 207 } // namespace extensions |
OLD | NEW |