| 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 "core/timing/Performance.h" | 5 #include "core/timing/Performance.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/PerformanceObserverCallback.h" | 7 #include "bindings/core/v8/PerformanceObserverCallback.h" |
| 8 #include "bindings/core/v8/V8BindingForTesting.h" | 8 #include "bindings/core/v8/V8BindingForTesting.h" |
| 9 #include "core/dom/TaskRunnerHelper.h" | 9 #include "core/dom/TaskRunnerHelper.h" |
| 10 #include "core/testing/DummyPageHolder.h" | 10 #include "core/testing/DummyPageHolder.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 DEFINE_INLINE_TRACE() { PerformanceBase::trace(visitor); } | 40 DEFINE_INLINE_TRACE() { PerformanceBase::trace(visitor); } |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 class PerformanceBaseTest : public ::testing::Test { | 43 class PerformanceBaseTest : public ::testing::Test { |
| 44 protected: | 44 protected: |
| 45 void initialize(ScriptState* scriptState) { | 45 void initialize(ScriptState* scriptState) { |
| 46 v8::Local<v8::Function> callback = | 46 v8::Local<v8::Function> callback = |
| 47 v8::Function::New(scriptState->context(), nullptr).ToLocalChecked(); | 47 v8::Function::New(scriptState->context(), nullptr).ToLocalChecked(); |
| 48 m_base = new TestPerformanceBase(scriptState); | 48 m_base = new TestPerformanceBase(scriptState); |
| 49 m_cb = PerformanceObserverCallback::create(scriptState, callback); | 49 m_cb = PerformanceObserverCallback::Create(scriptState, callback); |
| 50 m_observer = PerformanceObserver::create(scriptState->getExecutionContext(), | 50 m_observer = PerformanceObserver::create(scriptState->getExecutionContext(), |
| 51 m_base, m_cb); | 51 m_base, m_cb); |
| 52 } | 52 } |
| 53 | 53 |
| 54 void SetUp() override { | 54 void SetUp() override { |
| 55 m_pageHolder = DummyPageHolder::create(IntSize(800, 600)); | 55 m_pageHolder = DummyPageHolder::create(IntSize(800, 600)); |
| 56 m_executionContext = new NullExecutionContext(); | 56 m_executionContext = new NullExecutionContext(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 ExecutionContext* getExecutionContext() { return m_executionContext.get(); } | 59 ExecutionContext* getExecutionContext() { return m_executionContext.get(); } |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 172 |
| 173 // When cross-origin redirect opts in. | 173 // When cross-origin redirect opts in. |
| 174 redirectChain.back().setHTTPHeaderField(HTTPNames::Timing_Allow_Origin, | 174 redirectChain.back().setHTTPHeaderField(HTTPNames::Timing_Allow_Origin, |
| 175 originDomain); | 175 originDomain); |
| 176 EXPECT_TRUE(allowsTimingRedirect(redirectChain, finalResponse, | 176 EXPECT_TRUE(allowsTimingRedirect(redirectChain, finalResponse, |
| 177 *securityOrigin.get(), | 177 *securityOrigin.get(), |
| 178 getExecutionContext())); | 178 getExecutionContext())); |
| 179 } | 179 } |
| 180 | 180 |
| 181 } // namespace blink | 181 } // namespace blink |
| OLD | NEW |