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

Unified Diff: cc/surfaces/surface_factory_unittest.cc

Issue 1996783002: Make cc::SurfaceId unguessable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Ben's comment Created 4 years, 7 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/surfaces/surface_factory_client.h ('k') | cc/surfaces/surface_hittest_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_factory_unittest.cc
diff --git a/cc/surfaces/surface_factory_unittest.cc b/cc/surfaces/surface_factory_unittest.cc
index d458e0295f6bcb512ecb6c8f3de0ac015996c766..5a062c84090fd58bb2f1169fbc9c5ebe652cdf8d 100644
--- a/cc/surfaces/surface_factory_unittest.cc
+++ b/cc/surfaces/surface_factory_unittest.cc
@@ -66,7 +66,7 @@ class SurfaceFactoryTest : public testing::Test, public SurfaceDamageObserver {
public:
SurfaceFactoryTest()
: factory_(new SurfaceFactory(&manager_, &client_)),
- surface_id_(3),
+ surface_id_(0, 3, 0),
frame_sync_token_(GenTestSyncToken(4)),
consumer_sync_token_(GenTestSyncToken(5)) {
manager_.AddObserver(this);
@@ -419,7 +419,7 @@ TEST_F(SurfaceFactoryTest, ResourceLifetime) {
}
TEST_F(SurfaceFactoryTest, BlankNoIndexIncrement) {
- SurfaceId surface_id(6);
+ SurfaceId surface_id(0, 6, 0);
factory_->Create(surface_id);
Surface* surface = manager_.GetSurfaceForId(surface_id);
ASSERT_NE(nullptr, surface);
@@ -437,7 +437,7 @@ void CreateSurfaceDrawCallback(SurfaceFactory* factory,
uint32_t* execute_count,
SurfaceDrawStatus* result,
SurfaceDrawStatus drawn) {
- SurfaceId new_id(7);
+ SurfaceId new_id(0, 7, 0);
factory->Create(new_id);
factory->Destroy(new_id);
*execute_count += 1;
@@ -445,7 +445,7 @@ void CreateSurfaceDrawCallback(SurfaceFactory* factory,
}
TEST_F(SurfaceFactoryTest, AddDuringDestroy) {
- SurfaceId surface_id(6);
+ SurfaceId surface_id(0, 6, 0);
factory_->Create(surface_id);
std::unique_ptr<CompositorFrame> frame(new CompositorFrame);
frame->delegated_frame_data.reset(new DelegatedFrameData);
@@ -471,7 +471,7 @@ void DrawCallback(uint32_t* execute_count,
// Tests doing a DestroyAll before shutting down the factory;
TEST_F(SurfaceFactoryTest, DestroyAll) {
- SurfaceId id(7);
+ SurfaceId id(0, 7, 0);
factory_->Create(id);
std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
@@ -494,7 +494,7 @@ TEST_F(SurfaceFactoryTest, DestroyAll) {
}
TEST_F(SurfaceFactoryTest, DestroySequence) {
- SurfaceId id2(5);
+ SurfaceId id2(0, 5, 0);
factory_->Create(id2);
manager_.RegisterSurfaceIdNamespace(0);
@@ -527,7 +527,7 @@ TEST_F(SurfaceFactoryTest, DestroySequence) {
// Sequences to be ignored.
TEST_F(SurfaceFactoryTest, InvalidIdNamespace) {
uint32_t id_namespace = 9u;
- SurfaceId id(5);
+ SurfaceId id(id_namespace, 5, 0);
factory_->Create(id);
manager_.RegisterSurfaceIdNamespace(id_namespace);
@@ -546,7 +546,7 @@ TEST_F(SurfaceFactoryTest, InvalidIdNamespace) {
}
TEST_F(SurfaceFactoryTest, DestroyCycle) {
- SurfaceId id2(5);
+ SurfaceId id2(0, 5, 0);
factory_->Create(id2);
manager_.RegisterSurfaceIdNamespace(0);
« no previous file with comments | « cc/surfaces/surface_factory_client.h ('k') | cc/surfaces/surface_hittest_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698