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

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: Fixed more build targets 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
Index: cc/surfaces/surface_factory_unittest.cc
diff --git a/cc/surfaces/surface_factory_unittest.cc b/cc/surfaces/surface_factory_unittest.cc
index 1d7a8b92d669b85612df04d8fcce3d0b19bb5f4d..24a5a7a1c0e71874846531d87e066232f94156c8 100644
--- a/cc/surfaces/surface_factory_unittest.cc
+++ b/cc/surfaces/surface_factory_unittest.cc
@@ -58,7 +58,7 @@ class TestSurfaceFactoryClient : public SurfaceFactoryClient {
class SurfaceFactoryTest : public testing::Test {
public:
SurfaceFactoryTest()
- : factory_(new SurfaceFactory(&manager_, &client_)), surface_id_(3) {
+ : factory_(new SurfaceFactory(&manager_, &client_)), surface_id_(0, 3) {
factory_->Create(surface_id_);
}
@@ -389,7 +389,7 @@ TEST_F(SurfaceFactoryTest, ResourceLifetime) {
}
TEST_F(SurfaceFactoryTest, BlankNoIndexIncrement) {
- SurfaceId surface_id(6);
+ SurfaceId surface_id(0, 6);
factory_->Create(surface_id);
Surface* surface = manager_.GetSurfaceForId(surface_id);
ASSERT_NE(nullptr, surface);
@@ -412,7 +412,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);
factory_->Create(id);
std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
@@ -435,7 +435,7 @@ TEST_F(SurfaceFactoryTest, DestroyAll) {
}
TEST_F(SurfaceFactoryTest, DestroySequence) {
- SurfaceId id2(5);
+ SurfaceId id2(0, 5);
factory_->Create(id2);
manager_.RegisterSurfaceIdNamespace(0);
@@ -468,7 +468,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);
factory_->Create(id);
manager_.RegisterSurfaceIdNamespace(id_namespace);
@@ -487,7 +487,7 @@ TEST_F(SurfaceFactoryTest, InvalidIdNamespace) {
}
TEST_F(SurfaceFactoryTest, DestroyCycle) {
- SurfaceId id2(5);
+ SurfaceId id2(0, 5);
factory_->Create(id2);
manager_.RegisterSurfaceIdNamespace(0);

Powered by Google App Engine
This is Rietveld 408576698