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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 } | 111 } |
112 | 112 |
113 bindings_system_ = base::MakeUnique<APIBindingsSystem>( | 113 bindings_system_ = base::MakeUnique<APIBindingsSystem>( |
114 base::Bind(&RunFunctionOnGlobalAndIgnoreResult), | 114 base::Bind(&RunFunctionOnGlobalAndIgnoreResult), |
115 base::Bind(&RunFunctionOnGlobalAndReturnHandle), | 115 base::Bind(&RunFunctionOnGlobalAndReturnHandle), |
116 base::Bind(&APIBindingsSystemTest::GetAPISchema, base::Unretained(this)), | 116 base::Bind(&APIBindingsSystemTest::GetAPISchema, base::Unretained(this)), |
117 base::Bind(&AllowAllAPIs), | 117 base::Bind(&AllowAllAPIs), |
118 base::Bind(&APIBindingsSystemTest::OnAPIRequest, base::Unretained(this)), | 118 base::Bind(&APIBindingsSystemTest::OnAPIRequest, base::Unretained(this)), |
119 base::Bind(&APIBindingsSystemTest::OnEventListenersChanged, | 119 base::Bind(&APIBindingsSystemTest::OnEventListenersChanged, |
120 base::Unretained(this)), | 120 base::Unretained(this)), |
| 121 binding::AddConsoleError(), |
121 APILastError(base::Bind(&APIBindingsSystemTest::GetLastErrorParent, | 122 APILastError(base::Bind(&APIBindingsSystemTest::GetLastErrorParent, |
122 base::Unretained(this)), | 123 base::Unretained(this)), |
123 APILastError::AddConsoleError())); | 124 binding::AddConsoleError())); |
124 } | 125 } |
125 | 126 |
126 void APIBindingsSystemTest::TearDown() { | 127 void APIBindingsSystemTest::TearDown() { |
127 // Dispose all contexts now so that we call WillReleaseContext(). | 128 // Dispose all contexts now so that we call WillReleaseContext(). |
128 DisposeAllContexts(); | 129 DisposeAllContexts(); |
129 bindings_system_.reset(); | 130 bindings_system_.reset(); |
130 APIBindingTest::TearDown(); | 131 APIBindingTest::TearDown(); |
131 } | 132 } |
132 | 133 |
133 void APIBindingsSystemTest::OnWillDisposeContext( | 134 void APIBindingsSystemTest::OnWillDisposeContext( |
(...skipping 336 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 |