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

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

Issue 2657613005: [Extensions Bindings] Add chrome.runtime.lastError support (Closed)
Patch Set: . Created 3 years, 10 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/api_binding_test_util.cc ('k') | extensions/renderer/api_bindings_system.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/memory/ptr_util.h" 6 #include "base/memory/ptr_util.h"
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "extensions/renderer/api_binding.h" 10 #include "extensions/renderer/api_binding.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 v8::Local<v8::Context> context) { 130 v8::Local<v8::Context> context) {
131 last_request_ = std::move(request); 131 last_request_ = std::move(request);
132 } 132 }
133 133
134 protected: 134 protected:
135 APIBindingUnittest() 135 APIBindingUnittest()
136 : type_refs_(APITypeReferenceMap::InitializeTypeCallback()) {} 136 : type_refs_(APITypeReferenceMap::InitializeTypeCallback()) {}
137 void SetUp() override { 137 void SetUp() override {
138 APIBindingTest::SetUp(); 138 APIBindingTest::SetUp();
139 request_handler_ = base::MakeUnique<APIRequestHandler>( 139 request_handler_ = base::MakeUnique<APIRequestHandler>(
140 base::Bind(&RunFunctionOnGlobalAndIgnoreResult)); 140 base::Bind(&RunFunctionOnGlobalAndIgnoreResult),
141 APILastError(APILastError::GetParent()));
141 } 142 }
142 143
143 void TearDown() override { 144 void TearDown() override {
144 request_handler_.reset(); 145 request_handler_.reset();
145 event_handler_.reset(); 146 event_handler_.reset();
146 binding_.reset(); 147 binding_.reset();
147 APIBindingTest::TearDown(); 148 APIBindingTest::TearDown();
148 } 149 }
149 150
150 void SetFunctions(const char* functions) { 151 void SetFunctions(const char* functions) {
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 1014
1014 blink::WebScopedUserGesture user_gesture(nullptr); 1015 blink::WebScopedUserGesture user_gesture(nullptr);
1015 RunFunction(function, context, arraysize(argv), argv); 1016 RunFunction(function, context, arraysize(argv), argv);
1016 ASSERT_TRUE(last_request()); 1017 ASSERT_TRUE(last_request());
1017 EXPECT_TRUE(last_request()->has_user_gesture); 1018 EXPECT_TRUE(last_request()->has_user_gesture);
1018 1019
1019 reset_last_request(); 1020 reset_last_request();
1020 } 1021 }
1021 1022
1022 } // namespace extensions 1023 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/api_binding_test_util.cc ('k') | extensions/renderer/api_bindings_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698