| OLD | NEW |
| 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 "config.h" | 5 #include "config.h" |
| 6 #include "bindings/core/v8/V8ScriptRunner.h" | 6 #include "bindings/core/v8/V8ScriptRunner.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
| 9 #include "core/fetch/ScriptResource.h" | 9 #include "core/fetch/ScriptResource.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| 11 #include <gtest/gtest.h> | 11 #include <gtest/gtest.h> |
| 12 #include <v8.h> | 12 #include <v8.h> |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 class V8ScriptRunnerTest : public ::testing::Test { | 18 class V8ScriptRunnerTest : public ::testing::Test { |
| 19 public: | 19 public: |
| 20 V8ScriptRunnerTest() : m_scope(v8::Isolate::GetCurrent()) { } | 20 V8ScriptRunnerTest() : m_scope(v8::Isolate::GetCurrent()) { } |
| 21 virtual ~V8ScriptRunnerTest() { } | 21 virtual ~V8ScriptRunnerTest() { } |
| 22 | 22 |
| 23 virtual void SetUp() OVERRIDE | 23 virtual void SetUp() override |
| 24 { | 24 { |
| 25 // To trick various layers of caching, increment a counter for each | 25 // To trick various layers of caching, increment a counter for each |
| 26 // test and use it in code(), fielname() and url(). | 26 // test and use it in code(), fielname() and url(). |
| 27 counter++; | 27 counter++; |
| 28 } | 28 } |
| 29 | 29 |
| 30 virtual void TearDown() OVERRIDE | 30 virtual void TearDown() override |
| 31 { | 31 { |
| 32 m_resourceRequest.clear(); | 32 m_resourceRequest.clear(); |
| 33 m_resource.clear(); | 33 m_resource.clear(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 v8::Isolate* isolate() const | 36 v8::Isolate* isolate() const |
| 37 { | 37 { |
| 38 return m_scope.isolate(); | 38 return m_scope.isolate(); |
| 39 } | 39 } |
| 40 WTF::String code() const | 40 WTF::String code() const |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 EXPECT_FALSE(m_resource->cachedMetadata(tagForParserCache())); | 137 EXPECT_FALSE(m_resource->cachedMetadata(tagForParserCache())); |
| 138 | 138 |
| 139 // FIXME: Code caching is presently still disabled. | 139 // FIXME: Code caching is presently still disabled. |
| 140 // Enable EXPECT when code caching lands. | 140 // Enable EXPECT when code caching lands. |
| 141 // EXPECT_TRUE(m_resource->cachedMetadata(tagForCodeCache())); | 141 // EXPECT_TRUE(m_resource->cachedMetadata(tagForCodeCache())); |
| 142 } | 142 } |
| 143 | 143 |
| 144 } // namespace | 144 } // namespace |
| 145 | 145 |
| 146 } // namespace blink | 146 } // namespace blink |
| OLD | NEW |