Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / extensions / renderer / script_context_unittest.cc
blobb0a846c6b66dd7ff3465154f9c8c062061dabf58
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "extensions/renderer/module_system_test.h"
6 #include "extensions/renderer/script_context.h"
7 #include "gin/per_context_data.h"
8 #include "gin/runner.h"
10 namespace extensions {
12 using ScriptContextTest = ModuleSystemTest;
14 TEST_F(ScriptContextTest, GinRunnerLifetime) {
15 ExpectNoAssertionsMade();
16 base::WeakPtr<gin::Runner> weak_runner =
17 gin::PerContextData::From(env()->context()->v8_context())
18 ->runner()
19 ->GetWeakPtr();
20 env()->ShutdownModuleSystem();
21 EXPECT_FALSE(weak_runner);
24 } // namespace extensions