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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/memory/ptr_util.h" | 6 #include "base/memory/ptr_util.h" |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "extensions/renderer/api_binding.h" | 10 #include "extensions/renderer/api_binding.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 v8::Local<v8::Context> context) { | 130 v8::Local<v8::Context> context) { |
131 last_request_ = std::move(request); | 131 last_request_ = std::move(request); |
132 } | 132 } |
133 | 133 |
134 protected: | 134 protected: |
135 APIBindingUnittest() | 135 APIBindingUnittest() |
136 : type_refs_(APITypeReferenceMap::InitializeTypeCallback()) {} | 136 : type_refs_(APITypeReferenceMap::InitializeTypeCallback()) {} |
137 void SetUp() override { | 137 void SetUp() override { |
138 APIBindingTest::SetUp(); | 138 APIBindingTest::SetUp(); |
139 request_handler_ = base::MakeUnique<APIRequestHandler>( | 139 request_handler_ = base::MakeUnique<APIRequestHandler>( |
140 base::Bind(&RunFunctionOnGlobalAndIgnoreResult)); | 140 base::Bind(&RunFunctionOnGlobalAndIgnoreResult), |
| 141 APILastError(APILastError::GetParent())); |
141 } | 142 } |
142 | 143 |
143 void TearDown() override { | 144 void TearDown() override { |
144 request_handler_.reset(); | 145 request_handler_.reset(); |
145 event_handler_.reset(); | 146 event_handler_.reset(); |
146 binding_.reset(); | 147 binding_.reset(); |
147 APIBindingTest::TearDown(); | 148 APIBindingTest::TearDown(); |
148 } | 149 } |
149 | 150 |
150 void SetFunctions(const char* functions) { | 151 void SetFunctions(const char* functions) { |
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 | 1014 |
1014 blink::WebScopedUserGesture user_gesture(nullptr); | 1015 blink::WebScopedUserGesture user_gesture(nullptr); |
1015 RunFunction(function, context, arraysize(argv), argv); | 1016 RunFunction(function, context, arraysize(argv), argv); |
1016 ASSERT_TRUE(last_request()); | 1017 ASSERT_TRUE(last_request()); |
1017 EXPECT_TRUE(last_request()->has_user_gesture); | 1018 EXPECT_TRUE(last_request()->has_user_gesture); |
1018 | 1019 |
1019 reset_last_request(); | 1020 reset_last_request(); |
1020 } | 1021 } |
1021 | 1022 |
1022 } // namespace extensions | 1023 } // namespace extensions |
OLD | NEW |