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

Side by Side Diff: third_party/WebKit/Source/core/timing/PerformanceBaseTest.cpp

Issue 2646933002: Move PerformanceBase to TaskRunnerTimer. (Closed)
Patch Set: Created 3 years, 11 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 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/testing/DummyPageHolder.h" 9 #include "core/testing/DummyPageHolder.h"
10 #include "core/testing/NullExecutionContext.h" 10 #include "core/testing/NullExecutionContext.h"
11 #include "core/timing/PerformanceBase.h" 11 #include "core/timing/PerformanceBase.h"
12 #include "core/timing/PerformanceLongTaskTiming.h" 12 #include "core/timing/PerformanceLongTaskTiming.h"
13 #include "core/timing/PerformanceObserver.h" 13 #include "core/timing/PerformanceObserver.h"
14 #include "core/timing/PerformanceObserverInit.h" 14 #include "core/timing/PerformanceObserverInit.h"
15 #include "platform/network/ResourceResponse.h" 15 #include "platform/network/ResourceResponse.h"
16 #include "public/platform/Platform.h"
17 #include "public/platform/WebThread.h"
16 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
17 19
18 namespace blink { 20 namespace blink {
19 21
20 class TestPerformanceBase : public PerformanceBase { 22 class TestPerformanceBase : public PerformanceBase {
21 public: 23 public:
22 TestPerformanceBase() : PerformanceBase(0) {} 24 TestPerformanceBase()
25 : PerformanceBase(
26 0,
27 Platform::current()->currentThread()->getWebTaskRunner()) {}
haraken 2017/01/20 02:30:25 I'd prefer using TaskType::PerformanceTimeline (ju
jbroman 2017/01/20 02:33:35 With which LocalFrame/Document/ExecutionContext/Sc
23 ~TestPerformanceBase() {} 28 ~TestPerformanceBase() {}
24 29
25 ExecutionContext* getExecutionContext() const override { return nullptr; } 30 ExecutionContext* getExecutionContext() const override { return nullptr; }
26 31
27 int numActiveObservers() { return m_activeObservers.size(); } 32 int numActiveObservers() { return m_activeObservers.size(); }
28 33
29 int numObservers() { return m_observers.size(); } 34 int numObservers() { return m_observers.size(); }
30 35
31 bool hasPerformanceObserverFor(PerformanceEntry::EntryType entryType) { 36 bool hasPerformanceObserverFor(PerformanceEntry::EntryType entryType) {
32 return hasObserverFor(entryType); 37 return hasObserverFor(entryType);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 194
190 // When cross-origin redirect opts in. 195 // When cross-origin redirect opts in.
191 redirectChain.back().setHTTPHeaderField(HTTPNames::Timing_Allow_Origin, 196 redirectChain.back().setHTTPHeaderField(HTTPNames::Timing_Allow_Origin,
192 originDomain); 197 originDomain);
193 EXPECT_TRUE(allowsTimingRedirect(redirectChain, finalResponse, 198 EXPECT_TRUE(allowsTimingRedirect(redirectChain, finalResponse,
194 *securityOrigin.get(), 199 *securityOrigin.get(),
195 getExecutionContext())); 200 getExecutionContext()));
196 } 201 }
197 202
198 } // namespace blink 203 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698