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

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

Issue 2961103002: [Extensions Bindings] Add an ExceptionHandler class (Closed)
Patch Set: rebase Created 3 years, 5 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
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/bindings/declarative_event.h" 5 #include "extensions/renderer/bindings/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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 auto prop = base::MakeUnique<ArgumentSpec>(ArgumentType::STRING); 87 auto prop = base::MakeUnique<ArgumentSpec>(ArgumentType::STRING);
88 ArgumentSpec::PropertiesMap props; 88 ArgumentSpec::PropertiesMap props;
89 props["url"] = std::move(prop); 89 props["url"] = std::move(prop);
90 condition->set_properties(std::move(props)); 90 condition->set_properties(std::move(props));
91 type_refs_.AddSpec("condition", std::move(condition)); 91 type_refs_.AddSpec("condition", std::move(condition));
92 } 92 }
93 93
94 request_handler_ = base::MakeUnique<APIRequestHandler>( 94 request_handler_ = base::MakeUnique<APIRequestHandler>(
95 base::Bind(&DeclarativeEventTest::OnRequest, base::Unretained(this)), 95 base::Bind(&DeclarativeEventTest::OnRequest, base::Unretained(this)),
96 base::Bind(&RunFunctionOnGlobalAndIgnoreResult), 96 base::Bind(&RunFunctionOnGlobalAndIgnoreResult),
97 APILastError(APILastError::GetParent(), 97 APILastError(APILastError::GetParent(), binding::AddConsoleError()),
98 APILastError::AddConsoleError())); 98 nullptr);
99 } 99 }
100 100
101 void TearDown() override { 101 void TearDown() override {
102 request_handler_.reset(); 102 request_handler_.reset();
103 APIBindingTest::TearDown(); 103 APIBindingTest::TearDown();
104 } 104 }
105 105
106 APITypeReferenceMap type_refs_; 106 APITypeReferenceMap type_refs_;
107 std::unique_ptr<APIRequestHandler> request_handler_; 107 std::unique_ptr<APIRequestHandler> request_handler_;
108 std::unique_ptr<APIRequestHandler::Request> last_request_; 108 std::unique_ptr<APIRequestHandler::Request> last_request_;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 "})"; 249 "})";
250 v8::Local<v8::Function> remove_rules = 250 v8::Local<v8::Function> remove_rules =
251 FunctionFromString(context, kGetRules); 251 FunctionFromString(context, kGetRules);
252 RunFunctionOnGlobal(remove_rules, context, arraysize(args), args); 252 RunFunctionOnGlobal(remove_rules, context, arraysize(args), args);
253 ValidateLastRequest("events.getRules", "['alpha.declarativeEvent',0,null]"); 253 ValidateLastRequest("events.getRules", "['alpha.declarativeEvent',0,null]");
254 reset_last_request(); 254 reset_last_request();
255 } 255 }
256 } 256 }
257 257
258 } // namespace extensions 258 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698