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

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

Issue 2961103002: [Extensions Bindings] Add an ExceptionHandler class (Closed)
Patch Set: rebase + nits Created 3 years, 5 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
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/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
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
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
OLDNEW
« no previous file with comments | « extensions/renderer/bindings/api_bindings_system.cc ('k') | extensions/renderer/bindings/api_last_error.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698