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

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

Issue 2722463006: [Extensions Bindings] Notify of event unregistration on invalidation (Closed)
Patch Set: Rebase Created 3 years, 9 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_bindings_system.cc ('k') | extensions/renderer/api_event_handler.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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 base::Bind(&APIBindingsSystemTestBase::GetAPISchema, 115 base::Bind(&APIBindingsSystemTestBase::GetAPISchema,
116 base::Unretained(this)), 116 base::Unretained(this)),
117 base::Bind(&APIBindingsSystemTestBase::OnAPIRequest, 117 base::Bind(&APIBindingsSystemTestBase::OnAPIRequest,
118 base::Unretained(this)), 118 base::Unretained(this)),
119 base::Bind(&APIBindingsSystemTestBase::OnEventListenersChanged, 119 base::Bind(&APIBindingsSystemTestBase::OnEventListenersChanged,
120 base::Unretained(this)), 120 base::Unretained(this)),
121 APILastError(APILastError::GetParent())); 121 APILastError(APILastError::GetParent()));
122 } 122 }
123 123
124 void TearDown() override { 124 void TearDown() override {
125 {
126 v8::HandleScope handle_scope(isolate());
127 bindings_system_->WillReleaseContext(ContextLocal());
128 }
125 bindings_system_.reset(); 129 bindings_system_.reset();
126 APIBindingTest::TearDown(); 130 APIBindingTest::TearDown();
127 } 131 }
128 132
129 // Checks that |last_request_| exists and was provided with the 133 // Checks that |last_request_| exists and was provided with the
130 // |expected_name| and |expected_arguments|. 134 // |expected_name| and |expected_arguments|.
131 void ValidateLastRequest(const std::string& expected_name, 135 void ValidateLastRequest(const std::string& expected_name,
132 const std::string& expected_arguments); 136 const std::string& expected_arguments);
133 137
134 const APIRequestHandler::Request* last_request() const { 138 const APIRequestHandler::Request* last_request() const {
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 context, "idleState")); 586 context, "idleState"));
583 bindings_system()->FireEventInContext("idle.onStateChanged", context, 587 bindings_system()->FireEventInContext("idle.onStateChanged", context,
584 *ListValueFromString("['active']")); 588 *ListValueFromString("['active']"));
585 589
586 EXPECT_EQ("\"active\"", GetStringPropertyFromObject(context->Global(), 590 EXPECT_EQ("\"active\"", GetStringPropertyFromObject(context->Global(),
587 context, "idleState")); 591 context, "idleState"));
588 } 592 }
589 } 593 }
590 594
591 } // namespace extensions 595 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/api_bindings_system.cc ('k') | extensions/renderer/api_event_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698