| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 155 } |
| 156 | 156 |
| 157 bindings_system_ = base::MakeUnique<APIBindingsSystem>( | 157 bindings_system_ = base::MakeUnique<APIBindingsSystem>( |
| 158 base::Bind(&RunFunctionOnGlobalAndIgnoreResult), | 158 base::Bind(&RunFunctionOnGlobalAndIgnoreResult), |
| 159 base::Bind(&RunFunctionOnGlobalAndReturnHandle), | 159 base::Bind(&RunFunctionOnGlobalAndReturnHandle), |
| 160 base::Bind(&APIBindingsSystemTest::GetAPISchema, base::Unretained(this)), | 160 base::Bind(&APIBindingsSystemTest::GetAPISchema, base::Unretained(this)), |
| 161 base::Bind(&APIBindingsSystemTest::OnAPIRequest, base::Unretained(this)), | 161 base::Bind(&APIBindingsSystemTest::OnAPIRequest, base::Unretained(this)), |
| 162 base::Bind(&APIBindingsSystemTest::OnEventListenersChanged, | 162 base::Bind(&APIBindingsSystemTest::OnEventListenersChanged, |
| 163 base::Unretained(this)), | 163 base::Unretained(this)), |
| 164 APILastError(base::Bind(&APIBindingsSystemTest::GetLastErrorParent, | 164 APILastError(base::Bind(&APIBindingsSystemTest::GetLastErrorParent, |
| 165 base::Unretained(this)))); | 165 base::Unretained(this)), |
| 166 APILastError::AddConsoleError())); |
| 166 } | 167 } |
| 167 | 168 |
| 168 void APIBindingsSystemTest::TearDown() { | 169 void APIBindingsSystemTest::TearDown() { |
| 169 // Dispose all contexts now so that we call WillReleaseContext(). | 170 // Dispose all contexts now so that we call WillReleaseContext(). |
| 170 DisposeAllContexts(); | 171 DisposeAllContexts(); |
| 171 bindings_system_.reset(); | 172 bindings_system_.reset(); |
| 172 APIBindingTest::TearDown(); | 173 APIBindingTest::TearDown(); |
| 173 } | 174 } |
| 174 | 175 |
| 175 void APIBindingsSystemTest::OnWillDisposeContext( | 176 void APIBindingsSystemTest::OnWillDisposeContext( |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 v8::Local<v8::Value> other_event = | 509 v8::Local<v8::Value> other_event = |
| 509 GetPropertyFromObject(api, context, "alphaOtherEvent"); | 510 GetPropertyFromObject(api, context, "alphaOtherEvent"); |
| 510 ASSERT_TRUE(other_event->IsObject()); | 511 ASSERT_TRUE(other_event->IsObject()); |
| 511 EXPECT_EQ("\"alpha.alphaOtherEvent\"", | 512 EXPECT_EQ("\"alpha.alphaOtherEvent\"", |
| 512 GetStringPropertyFromObject(other_event.As<v8::Object>(), context, | 513 GetStringPropertyFromObject(other_event.As<v8::Object>(), context, |
| 513 "name")); | 514 "name")); |
| 514 EXPECT_NE(event, other_event); | 515 EXPECT_NE(event, other_event); |
| 515 } | 516 } |
| 516 | 517 |
| 517 } // namespace extensions | 518 } // namespace extensions |
| OLD | NEW |