| OLD | NEW |
| 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/api_bindings_system.h" | 5 #include "extensions/renderer/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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 std::vector<APIBindingsSystemTest::FakeSpec> APIBindingsSystemTest::GetAPIs() { | 139 std::vector<APIBindingsSystemTest::FakeSpec> APIBindingsSystemTest::GetAPIs() { |
| 140 return { | 140 return { |
| 141 {kAlphaAPIName, kAlphaAPISpec}, | 141 {kAlphaAPIName, kAlphaAPISpec}, |
| 142 {kBetaAPIName, kBetaAPISpec}, | 142 {kBetaAPIName, kBetaAPISpec}, |
| 143 {kGammaAPIName, kGammaAPISpec}, | 143 {kGammaAPIName, kGammaAPISpec}, |
| 144 }; | 144 }; |
| 145 } | 145 } |
| 146 | 146 |
| 147 v8::Local<v8::Object> APIBindingsSystemTest::GetLastErrorParent( | 147 v8::Local<v8::Object> APIBindingsSystemTest::GetLastErrorParent( |
| 148 v8::Local<v8::Context> context) { | 148 v8::Local<v8::Context> context, |
| 149 v8::Local<v8::Object>* secondary_parent) { |
| 149 return v8::Local<v8::Object>(); | 150 return v8::Local<v8::Object>(); |
| 150 } | 151 } |
| 151 | 152 |
| 152 const base::DictionaryValue& APIBindingsSystemTest::GetAPISchema( | 153 const base::DictionaryValue& APIBindingsSystemTest::GetAPISchema( |
| 153 const std::string& api_name) { | 154 const std::string& api_name) { |
| 154 EXPECT_TRUE(base::ContainsKey(api_schemas_, api_name)); | 155 EXPECT_TRUE(base::ContainsKey(api_schemas_, api_name)); |
| 155 return *api_schemas_[api_name]; | 156 return *api_schemas_[api_name]; |
| 156 } | 157 } |
| 157 | 158 |
| 158 void APIBindingsSystemTest::OnAPIRequest( | 159 void APIBindingsSystemTest::OnAPIRequest( |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 v8::Local<v8::Value> other_event = | 471 v8::Local<v8::Value> other_event = |
| 471 GetPropertyFromObject(api, context, "alphaOtherEvent"); | 472 GetPropertyFromObject(api, context, "alphaOtherEvent"); |
| 472 ASSERT_TRUE(other_event->IsObject()); | 473 ASSERT_TRUE(other_event->IsObject()); |
| 473 EXPECT_EQ("\"alpha.alphaOtherEvent\"", | 474 EXPECT_EQ("\"alpha.alphaOtherEvent\"", |
| 474 GetStringPropertyFromObject(other_event.As<v8::Object>(), context, | 475 GetStringPropertyFromObject(other_event.As<v8::Object>(), context, |
| 475 "name")); | 476 "name")); |
| 476 EXPECT_NE(event, other_event); | 477 EXPECT_NE(event, other_event); |
| 477 } | 478 } |
| 478 | 479 |
| 479 } // namespace extensions | 480 } // namespace extensions |
| OLD | NEW |