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

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: Rebasing + dusting off... Created 4 years, 10 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 540d9da22c3032ea36ac2b27b058bfe7e4ed90a1..7176c204435a5d12d8c2c55262eaa1bb8272394b 100644
--- a/cc/surfaces/surface_factory_unittest.cc
+++ b/cc/surfaces/surface_factory_unittest.cc
@@ -59,7 +59,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_);
}
@@ -390,7 +391,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);
@@ -413,7 +414,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 = SurfaceId::FromUnsafeValue(7);
factory_->Create(id);
scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData);
@@ -436,7 +437,7 @@ TEST_F(SurfaceFactoryTest, DestroyAll) {
}
TEST_F(SurfaceFactoryTest, DestroySequence) {
- SurfaceId id2(5);
+ SurfaceId id2 = SurfaceId::FromUnsafeValue(5);
factory_->Create(id2);
manager_.RegisterSurfaceIdNamespace(0);
@@ -469,7 +470,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);
@@ -488,7 +489,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