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

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

Issue 2819683002: [Extenisons Bindings] Don't throw unchecked errors; add console errors (Closed)
Patch Set: jbroman's Created 3 years, 8 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
« no previous file with comments | « extensions/renderer/api_binding_unittest.cc ('k') | extensions/renderer/api_last_error.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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
OLDNEW
« no previous file with comments | « extensions/renderer/api_binding_unittest.cc ('k') | extensions/renderer/api_last_error.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698