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/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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 } | 116 } |
117 | 117 |
118 bindings_system_ = base::MakeUnique<APIBindingsSystem>( | 118 bindings_system_ = base::MakeUnique<APIBindingsSystem>( |
119 base::Bind(&RunFunctionOnGlobalAndIgnoreResult), | 119 base::Bind(&RunFunctionOnGlobalAndIgnoreResult), |
120 base::Bind(&RunFunctionOnGlobalAndReturnHandle), | 120 base::Bind(&RunFunctionOnGlobalAndReturnHandle), |
121 base::Bind(&APIBindingsSystemTest::GetAPISchema, base::Unretained(this)), | 121 base::Bind(&APIBindingsSystemTest::GetAPISchema, base::Unretained(this)), |
122 base::Bind(&AllowAllAPIs), | 122 base::Bind(&AllowAllAPIs), |
123 base::Bind(&APIBindingsSystemTest::OnAPIRequest, base::Unretained(this)), | 123 base::Bind(&APIBindingsSystemTest::OnAPIRequest, base::Unretained(this)), |
124 base::Bind(&APIBindingsSystemTest::OnEventListenersChanged, | 124 base::Bind(&APIBindingsSystemTest::OnEventListenersChanged, |
125 base::Unretained(this)), | 125 base::Unretained(this)), |
126 base::Bind(&DoNothingWithSilentRequest), | 126 base::Bind(&DoNothingWithSilentRequest), binding::AddConsoleError(), |
127 APILastError(base::Bind(&APIBindingsSystemTest::GetLastErrorParent, | 127 APILastError(base::Bind(&APIBindingsSystemTest::GetLastErrorParent, |
128 base::Unretained(this)), | 128 base::Unretained(this)), |
129 APILastError::AddConsoleError())); | 129 binding::AddConsoleError())); |
130 } | 130 } |
131 | 131 |
132 void APIBindingsSystemTest::TearDown() { | 132 void APIBindingsSystemTest::TearDown() { |
133 // Dispose all contexts now so that we call WillReleaseContext(). | 133 // Dispose all contexts now so that we call WillReleaseContext(). |
134 DisposeAllContexts(); | 134 DisposeAllContexts(); |
135 bindings_system_.reset(); | 135 bindings_system_.reset(); |
136 APIBindingTest::TearDown(); | 136 APIBindingTest::TearDown(); |
137 } | 137 } |
138 | 138 |
139 void APIBindingsSystemTest::OnWillDisposeContext( | 139 void APIBindingsSystemTest::OnWillDisposeContext( |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 v8::Local<v8::Value> other_event = | 476 v8::Local<v8::Value> other_event = |
477 GetPropertyFromObject(api, context, "alphaOtherEvent"); | 477 GetPropertyFromObject(api, context, "alphaOtherEvent"); |
478 ASSERT_TRUE(other_event->IsObject()); | 478 ASSERT_TRUE(other_event->IsObject()); |
479 EXPECT_EQ("\"alpha.alphaOtherEvent\"", | 479 EXPECT_EQ("\"alpha.alphaOtherEvent\"", |
480 GetStringPropertyFromObject(other_event.As<v8::Object>(), context, | 480 GetStringPropertyFromObject(other_event.As<v8::Object>(), context, |
481 "name")); | 481 "name")); |
482 EXPECT_NE(event, other_event); | 482 EXPECT_NE(event, other_event); |
483 } | 483 } |
484 | 484 |
485 } // namespace extensions | 485 } // namespace extensions |
OLD | NEW |