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

Unified Diff: cc/surfaces/surface_factory_unittest.cc

Issue 2379653006: Replaced cc::SurfaceId::nonce_ with base::UnguessableToken (Closed)
Patch Set: Added static cast to LocalFrameId::hash() to avoid warnings when compiled on Windows Created 4 years, 1 month 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
Index: cc/surfaces/surface_factory_unittest.cc
diff --git a/cc/surfaces/surface_factory_unittest.cc b/cc/surfaces/surface_factory_unittest.cc
index 9ec949297a6bdbf4bc0a4710fb00f62f0fcdc5e4..a9eb0f3a7cc1ca2f57fdfa6c0fe8ec7494765e6e 100644
--- a/cc/surfaces/surface_factory_unittest.cc
+++ b/cc/surfaces/surface_factory_unittest.cc
@@ -68,7 +68,7 @@ class SurfaceFactoryTest : public testing::Test, public SurfaceObserver {
SurfaceFactoryTest()
: factory_(
new SurfaceFactory(kArbitraryFrameSinkId, &manager_, &client_)),
- local_frame_id_(3, 0),
+ local_frame_id_(3, base::UnguessableToken::Create()),
frame_sync_token_(GenTestSyncToken(4)),
consumer_sync_token_(GenTestSyncToken(5)) {
manager_.AddObserver(this);
@@ -432,7 +432,7 @@ TEST_F(SurfaceFactoryTest, ResourceLifetime) {
}
TEST_F(SurfaceFactoryTest, BlankNoIndexIncrement) {
- LocalFrameId local_frame_id(6, 0);
+ LocalFrameId local_frame_id(6, base::UnguessableToken::Create());
SurfaceId surface_id(kArbitraryFrameSinkId, local_frame_id);
factory_->Create(local_frame_id);
Surface* surface = manager_.GetSurfaceForId(surface_id);
@@ -448,14 +448,14 @@ TEST_F(SurfaceFactoryTest, BlankNoIndexIncrement) {
void CreateSurfaceDrawCallback(SurfaceFactory* factory,
uint32_t* execute_count) {
- LocalFrameId new_id(7, 0);
+ LocalFrameId new_id(7, base::UnguessableToken::Create());
factory->Create(new_id);
factory->Destroy(new_id);
*execute_count += 1;
}
TEST_F(SurfaceFactoryTest, AddDuringDestroy) {
- LocalFrameId local_frame_id(6, 0);
+ LocalFrameId local_frame_id(6, base::UnguessableToken::Create());
factory_->Create(local_frame_id);
uint32_t execute_count = 0;
@@ -474,7 +474,7 @@ void DrawCallback(uint32_t* execute_count) {
// Tests doing a DestroyAll before shutting down the factory;
TEST_F(SurfaceFactoryTest, DestroyAll) {
- LocalFrameId id(7, 0);
+ LocalFrameId id(7, base::UnguessableToken::Create());
factory_->Create(id);
TransferableResource resource;
@@ -492,7 +492,7 @@ TEST_F(SurfaceFactoryTest, DestroyAll) {
}
TEST_F(SurfaceFactoryTest, DestroySequence) {
- LocalFrameId local_frame_id2(5, 0);
+ LocalFrameId local_frame_id2(5, base::UnguessableToken::Create());
SurfaceId id2(kArbitraryFrameSinkId, local_frame_id2);
factory_->Create(local_frame_id2);
@@ -526,7 +526,7 @@ TEST_F(SurfaceFactoryTest, DestroySequence) {
TEST_F(SurfaceFactoryTest, InvalidFrameSinkId) {
FrameSinkId frame_sink_id(1234, 5678);
- LocalFrameId local_frame_id(5, 0);
+ LocalFrameId local_frame_id(5, base::UnguessableToken::Create());
SurfaceId id(factory_->frame_sink_id(), local_frame_id);
factory_->Create(local_frame_id);
@@ -546,7 +546,7 @@ TEST_F(SurfaceFactoryTest, InvalidFrameSinkId) {
}
TEST_F(SurfaceFactoryTest, DestroyCycle) {
- LocalFrameId local_frame_id2(5, 0);
+ LocalFrameId local_frame_id2(5, base::UnguessableToken::Create());
SurfaceId id2(kArbitraryFrameSinkId, local_frame_id2);
factory_->Create(local_frame_id2);

Powered by Google App Engine
This is Rietveld 408576698