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

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

Issue 2953133002: [Extensions Bindings] Support chrome.extension.lastError (Closed)
Patch Set: jbroman's, lazyboy's 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 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 "extensions/renderer/bindings/api_bindings_system.h" 5 #include "extensions/renderer/bindings/api_bindings_system.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 std::vector<APIBindingsSystemTest::FakeSpec> APIBindingsSystemTest::GetAPIs() { 138 std::vector<APIBindingsSystemTest::FakeSpec> APIBindingsSystemTest::GetAPIs() {
139 return { 139 return {
140 {kAlphaAPIName, kAlphaAPISpec}, 140 {kAlphaAPIName, kAlphaAPISpec},
141 {kBetaAPIName, kBetaAPISpec}, 141 {kBetaAPIName, kBetaAPISpec},
142 {kGammaAPIName, kGammaAPISpec}, 142 {kGammaAPIName, kGammaAPISpec},
143 }; 143 };
144 } 144 }
145 145
146 v8::Local<v8::Object> APIBindingsSystemTest::GetLastErrorParent( 146 v8::Local<v8::Object> APIBindingsSystemTest::GetLastErrorParent(
147 v8::Local<v8::Context> context) { 147 v8::Local<v8::Context> context,
148 v8::Local<v8::Object>* secondary_parent) {
148 return v8::Local<v8::Object>(); 149 return v8::Local<v8::Object>();
149 } 150 }
150 151
151 const base::DictionaryValue& APIBindingsSystemTest::GetAPISchema( 152 const base::DictionaryValue& APIBindingsSystemTest::GetAPISchema(
152 const std::string& api_name) { 153 const std::string& api_name) {
153 EXPECT_TRUE(base::ContainsKey(api_schemas_, api_name)); 154 EXPECT_TRUE(base::ContainsKey(api_schemas_, api_name));
154 return *api_schemas_[api_name]; 155 return *api_schemas_[api_name];
155 } 156 }
156 157
157 void APIBindingsSystemTest::OnAPIRequest( 158 void APIBindingsSystemTest::OnAPIRequest(
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 v8::Local<v8::Value> other_event = 470 v8::Local<v8::Value> other_event =
470 GetPropertyFromObject(api, context, "alphaOtherEvent"); 471 GetPropertyFromObject(api, context, "alphaOtherEvent");
471 ASSERT_TRUE(other_event->IsObject()); 472 ASSERT_TRUE(other_event->IsObject());
472 EXPECT_EQ("\"alpha.alphaOtherEvent\"", 473 EXPECT_EQ("\"alpha.alphaOtherEvent\"",
473 GetStringPropertyFromObject(other_event.As<v8::Object>(), context, 474 GetStringPropertyFromObject(other_event.As<v8::Object>(), context,
474 "name")); 475 "name"));
475 EXPECT_NE(event, other_event); 476 EXPECT_NE(event, other_event);
476 } 477 }
477 478
478 } // namespace extensions 479 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/bindings/api_bindings_system_unittest.h ('k') | extensions/renderer/bindings/api_last_error.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698