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

Unified Diff: cc/surfaces/surface_factory_unittest.cc

Issue 1496103002: Reusing base::IdType<...> to implement SurfaceId. Base URL: https://chromium.googlesource.com/chromium/src.git@type-safe-id-base
Patch Set: Created 5 years 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 fa05c2e93782bc357033857952717a0224e8022a..ae764ace46d855afb28201f8bbed3e93512fc55f 100644
--- a/cc/surfaces/surface_factory_unittest.cc
+++ b/cc/surfaces/surface_factory_unittest.cc
@@ -50,7 +50,8 @@ 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_(SurfaceId::FromUnsafeValue(3)) {
factory_->Create(surface_id_);
}
@@ -381,7 +382,7 @@ TEST_F(SurfaceFactoryTest, ResourceLifetime) {
}
TEST_F(SurfaceFactoryTest, BlankNoIndexIncrement) {
- SurfaceId surface_id(6);
+ SurfaceId surface_id = SurfaceId::FromUnsafeValue(6);
factory_->Create(surface_id);
Surface* surface = manager_.GetSurfaceForId(surface_id);
ASSERT_NE(nullptr, surface);
@@ -404,7 +405,7 @@ void DrawCallback(uint32* execute_count,
// Tests doing a DestroyAll before shutting down the factory;
TEST_F(SurfaceFactoryTest, DestroyAll) {
- SurfaceId id(7);
+ SurfaceId id = SurfaceId::FromUnsafeValue(7);
factory_->Create(id);
scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
@@ -427,7 +428,7 @@ TEST_F(SurfaceFactoryTest, DestroyAll) {
}
TEST_F(SurfaceFactoryTest, DestroySequence) {
- SurfaceId id2(5);
+ SurfaceId id2 = SurfaceId::FromUnsafeValue(5);
factory_->Create(id2);
manager_.RegisterSurfaceIdNamespace(0);
@@ -460,7 +461,7 @@ TEST_F(SurfaceFactoryTest, DestroySequence) {
// Sequences to be ignored.
TEST_F(SurfaceFactoryTest, InvalidIdNamespace) {
uint32_t id_namespace = 9u;
- SurfaceId id(5);
+ SurfaceId id = SurfaceId::FromUnsafeValue(5);
factory_->Create(id);
manager_.RegisterSurfaceIdNamespace(id_namespace);
@@ -479,7 +480,7 @@ TEST_F(SurfaceFactoryTest, InvalidIdNamespace) {
}
TEST_F(SurfaceFactoryTest, DestroyCycle) {
- SurfaceId id2(5);
+ SurfaceId id2 = SurfaceId::FromUnsafeValue(5);
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