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

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

Issue 2241203003: Pass user session type to extension feature checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split out some stuff Created 4 years, 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/module_system_test.h" 5 #include "extensions/renderer/module_system_test.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 : isolate_(isolate), 131 : isolate_(isolate),
132 context_holder_(new gin::ContextHolder(isolate_)), 132 context_holder_(new gin::ContextHolder(isolate_)),
133 handle_scope_(isolate_), 133 handle_scope_(isolate_),
134 source_map_(new StringSourceMap()) { 134 source_map_(new StringSourceMap()) {
135 context_holder_->SetContext(v8::Context::New( 135 context_holder_->SetContext(v8::Context::New(
136 isolate, g_v8_extension_configurator.Get().GetConfiguration())); 136 isolate, g_v8_extension_configurator.Get().GetConfiguration()));
137 context_.reset(new ScriptContext(context_holder_->context(), 137 context_.reset(new ScriptContext(context_holder_->context(),
138 nullptr, // WebFrame 138 nullptr, // WebFrame
139 nullptr, // Extension 139 nullptr, // Extension
140 Feature::BLESSED_EXTENSION_CONTEXT, 140 Feature::BLESSED_EXTENSION_CONTEXT,
141 Feature::SESSION_TYPE_UNSPECIFIED,
141 nullptr, // Effective Extension 142 nullptr, // Effective Extension
142 Feature::BLESSED_EXTENSION_CONTEXT)); 143 Feature::BLESSED_EXTENSION_CONTEXT));
143 context_->v8_context()->Enter(); 144 context_->v8_context()->Enter();
144 assert_natives_ = new AssertNatives(context_.get()); 145 assert_natives_ = new AssertNatives(context_.get());
145 146
146 { 147 {
147 std::unique_ptr<ModuleSystem> module_system( 148 std::unique_ptr<ModuleSystem> module_system(
148 new ModuleSystem(context_.get(), source_map_.get())); 149 new ModuleSystem(context_.get(), source_map_.get()));
149 context_->set_module_system(std::move(module_system)); 150 context_->set_module_system(std::move(module_system));
150 } 151 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 256
256 void ModuleSystemTest::ExpectNoAssertionsMade() { 257 void ModuleSystemTest::ExpectNoAssertionsMade() {
257 should_assertions_be_made_ = false; 258 should_assertions_be_made_ = false;
258 } 259 }
259 260
260 void ModuleSystemTest::RunResolvedPromises() { 261 void ModuleSystemTest::RunResolvedPromises() {
261 v8::MicrotasksScope::PerformCheckpoint(isolate_); 262 v8::MicrotasksScope::PerformCheckpoint(isolate_);
262 } 263 }
263 264
264 } // namespace extensions 265 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698