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

Unified Diff: cc/surfaces/surface_factory_unittest.cc

Issue 2379653006: Replaced cc::SurfaceId::nonce_ with base::UnguessableToken (Closed)
Patch Set: Changed comments in surface_id.h to reflect the change Created 4 years, 2 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
Index: cc/surfaces/surface_factory_unittest.cc
diff --git a/cc/surfaces/surface_factory_unittest.cc b/cc/surfaces/surface_factory_unittest.cc
index be74ec3beb149b74bcea9d22d407cbc8b0f96c7f..3b90819ad211d87319314b05a6a58e70e6cb8ccd 100644
--- a/cc/surfaces/surface_factory_unittest.cc
+++ b/cc/surfaces/surface_factory_unittest.cc
@@ -69,7 +69,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);
@@ -436,7 +436,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);
@@ -454,14 +454,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);
CompositorFrame frame;
frame.delegated_frame_data.reset(new DelegatedFrameData);
@@ -482,7 +482,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);
std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
@@ -502,7 +502,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);
@@ -538,7 +538,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);
@@ -558,7 +558,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