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

Unified Diff: cc/debug/frame_timing_tracker_unittest.cc

Issue 1137823002: Pass collected frame timing events to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed implementing virtual function on Android html_viewer. Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/debug/frame_timing_tracker.cc ('k') | cc/test/fake_layer_tree_host_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/frame_timing_tracker_unittest.cc
diff --git a/cc/debug/frame_timing_tracker_unittest.cc b/cc/debug/frame_timing_tracker_unittest.cc
index b5574435fbcfef1213ad22ff41bcfbaed883ff8a..2b5f941c0cb30b2d3cda8e8781088e30ca17918a 100644
--- a/cc/debug/frame_timing_tracker_unittest.cc
+++ b/cc/debug/frame_timing_tracker_unittest.cc
@@ -9,6 +9,9 @@
#include "base/trace_event/trace_event_argument.h"
#include "base/values.h"
#include "cc/debug/frame_timing_tracker.h"
+#include "cc/test/fake_impl_proxy.h"
+#include "cc/test/fake_layer_tree_host_impl.h"
+#include "cc/test/test_shared_bitmap_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cc {
@@ -70,7 +73,12 @@ std::string MainFrameToString(
}
TEST(FrameTimingTrackerTest, DefaultTrackerIsEmpty) {
- scoped_ptr<FrameTimingTracker> tracker(FrameTimingTracker::Create());
+ FakeImplProxy proxy;
+ TestSharedBitmapManager shared_bitmap_manager;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+
+ scoped_ptr<FrameTimingTracker> tracker(
+ FrameTimingTracker::Create(&host_impl));
EXPECT_EQ("{\"values\":[]}",
CompositeToString(tracker->GroupCompositeCountsByRectId()));
EXPECT_EQ("{\"values\":[]}",
@@ -78,7 +86,12 @@ TEST(FrameTimingTrackerTest, DefaultTrackerIsEmpty) {
}
TEST(FrameTimingTrackerTest, NoFrameIdsIsEmpty) {
- scoped_ptr<FrameTimingTracker> tracker(FrameTimingTracker::Create());
+ FakeImplProxy proxy;
+ TestSharedBitmapManager shared_bitmap_manager;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+
+ scoped_ptr<FrameTimingTracker> tracker(
+ FrameTimingTracker::Create(&host_impl));
std::vector<std::pair<int, int64_t>> ids;
tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(100), ids);
EXPECT_EQ("{\"values\":[]}",
@@ -86,7 +99,12 @@ TEST(FrameTimingTrackerTest, NoFrameIdsIsEmpty) {
}
TEST(FrameTimingTrackerTest, NoRectIdsYieldsNoMainFrameEvents) {
- scoped_ptr<FrameTimingTracker> tracker(FrameTimingTracker::Create());
+ FakeImplProxy proxy;
+ TestSharedBitmapManager shared_bitmap_manager;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+
+ scoped_ptr<FrameTimingTracker> tracker(
+ FrameTimingTracker::Create(&host_impl));
tracker->SaveMainFrameTimeStamps(std::vector<int64_t>(),
base::TimeTicks::FromInternalValue(100),
base::TimeTicks::FromInternalValue(110), 1);
@@ -95,7 +113,12 @@ TEST(FrameTimingTrackerTest, NoRectIdsYieldsNoMainFrameEvents) {
}
TEST(FrameTimingTrackerTest, OneFrameId) {
- scoped_ptr<FrameTimingTracker> tracker(FrameTimingTracker::Create());
+ FakeImplProxy proxy;
+ TestSharedBitmapManager shared_bitmap_manager;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+
+ scoped_ptr<FrameTimingTracker> tracker(
+ FrameTimingTracker::Create(&host_impl));
std::vector<std::pair<int, int64_t>> ids;
ids.push_back(std::make_pair(1, 2));
tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(100), ids);
@@ -106,7 +129,12 @@ TEST(FrameTimingTrackerTest, OneFrameId) {
}
TEST(FrameTimingTrackerTest, OneMainFrameRect) {
- scoped_ptr<FrameTimingTracker> tracker(FrameTimingTracker::Create());
+ FakeImplProxy proxy;
+ TestSharedBitmapManager shared_bitmap_manager;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+
+ scoped_ptr<FrameTimingTracker> tracker(
+ FrameTimingTracker::Create(&host_impl));
std::vector<int64_t> rect_ids;
rect_ids.push_back(1);
tracker->SaveMainFrameTimeStamps(rect_ids,
@@ -119,7 +147,12 @@ TEST(FrameTimingTrackerTest, OneMainFrameRect) {
}
TEST(FrameTimingTrackerTest, UnsortedTimestampsIds) {
- scoped_ptr<FrameTimingTracker> tracker(FrameTimingTracker::Create());
+ FakeImplProxy proxy;
+ TestSharedBitmapManager shared_bitmap_manager;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+
+ scoped_ptr<FrameTimingTracker> tracker(
+ FrameTimingTracker::Create(&host_impl));
std::vector<std::pair<int, int64_t>> ids;
ids.push_back(std::make_pair(1, 2));
tracker->SaveTimeStamps(base::TimeTicks::FromInternalValue(200), ids);
@@ -134,7 +167,12 @@ TEST(FrameTimingTrackerTest, UnsortedTimestampsIds) {
}
TEST(FrameTimingTrackerTest, MainFrameUnsortedTimestamps) {
- scoped_ptr<FrameTimingTracker> tracker(FrameTimingTracker::Create());
+ FakeImplProxy proxy;
+ TestSharedBitmapManager shared_bitmap_manager;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+
+ scoped_ptr<FrameTimingTracker> tracker(
+ FrameTimingTracker::Create(&host_impl));
std::vector<int64_t> rect_ids;
rect_ids.push_back(2);
tracker->SaveMainFrameTimeStamps(rect_ids,
@@ -155,7 +193,12 @@ TEST(FrameTimingTrackerTest, MainFrameUnsortedTimestamps) {
}
TEST(FrameTimingTrackerTest, MultipleFrameIds) {
- scoped_ptr<FrameTimingTracker> tracker(FrameTimingTracker::Create());
+ FakeImplProxy proxy;
+ TestSharedBitmapManager shared_bitmap_manager;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+
+ scoped_ptr<FrameTimingTracker> tracker(
+ FrameTimingTracker::Create(&host_impl));
std::vector<std::pair<int, int64_t>> ids200;
ids200.push_back(std::make_pair(1, 2));
@@ -187,7 +230,12 @@ TEST(FrameTimingTrackerTest, MultipleFrameIds) {
}
TEST(FrameTimingTrackerTest, MultipleMainFrameEvents) {
- scoped_ptr<FrameTimingTracker> tracker(FrameTimingTracker::Create());
+ FakeImplProxy proxy;
+ TestSharedBitmapManager shared_bitmap_manager;
+ FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, nullptr);
+
+ scoped_ptr<FrameTimingTracker> tracker(
+ FrameTimingTracker::Create(&host_impl));
std::vector<int64_t> rect_ids200;
rect_ids200.push_back(2);
« no previous file with comments | « cc/debug/frame_timing_tracker.cc ('k') | cc/test/fake_layer_tree_host_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698