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

Side by Side Diff: extensions/renderer/declarative_event_unittest.cc

Issue 2819683002: [Extenisons Bindings] Don't throw unchecked errors; add console errors (Closed)
Patch Set: jbroman's Created 3 years, 8 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
« no previous file with comments | « extensions/renderer/console.cc ('k') | extensions/renderer/module_system.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "extensions/renderer/declarative_event.h" 5 #include "extensions/renderer/declarative_event.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 auto prop = base::MakeUnique<ArgumentSpec>(ArgumentType::STRING); 91 auto prop = base::MakeUnique<ArgumentSpec>(ArgumentType::STRING);
92 ArgumentSpec::PropertiesMap props; 92 ArgumentSpec::PropertiesMap props;
93 props["url"] = std::move(prop); 93 props["url"] = std::move(prop);
94 condition->set_properties(std::move(props)); 94 condition->set_properties(std::move(props));
95 type_refs_.AddSpec("condition", std::move(condition)); 95 type_refs_.AddSpec("condition", std::move(condition));
96 } 96 }
97 97
98 request_handler_ = base::MakeUnique<APIRequestHandler>( 98 request_handler_ = base::MakeUnique<APIRequestHandler>(
99 base::Bind(&DeclarativeEventTest::OnRequest, base::Unretained(this)), 99 base::Bind(&DeclarativeEventTest::OnRequest, base::Unretained(this)),
100 base::Bind(&RunFunctionOnGlobalAndIgnoreResult), 100 base::Bind(&RunFunctionOnGlobalAndIgnoreResult),
101 APILastError(APILastError::GetParent())); 101 APILastError(APILastError::GetParent(),
102 APILastError::AddConsoleError()));
102 } 103 }
103 104
104 void TearDown() override { 105 void TearDown() override {
105 request_handler_.reset(); 106 request_handler_.reset();
106 APIBindingTest::TearDown(); 107 APIBindingTest::TearDown();
107 } 108 }
108 109
109 APITypeReferenceMap type_refs_; 110 APITypeReferenceMap type_refs_;
110 std::unique_ptr<APIRequestHandler> request_handler_; 111 std::unique_ptr<APIRequestHandler> request_handler_;
111 std::unique_ptr<APIRequestHandler::Request> last_request_; 112 std::unique_ptr<APIRequestHandler::Request> last_request_;
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 "})"; 254 "})";
254 v8::Local<v8::Function> remove_rules = 255 v8::Local<v8::Function> remove_rules =
255 FunctionFromString(context, kGetRules); 256 FunctionFromString(context, kGetRules);
256 RunFunctionOnGlobal(remove_rules, context, arraysize(args), args); 257 RunFunctionOnGlobal(remove_rules, context, arraysize(args), args);
257 ValidateLastRequest("events.getRules", "['alpha.declarativeEvent',0,null]"); 258 ValidateLastRequest("events.getRules", "['alpha.declarativeEvent',0,null]");
258 reset_last_request(); 259 reset_last_request();
259 } 260 }
260 } 261 }
261 262
262 } // namespace extensions 263 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/console.cc ('k') | extensions/renderer/module_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698