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

Side by Side Diff: content/browser/renderer_host/offscreen_canvas_surface_manager_unittest.cc

Issue 2610723002: Unify SurfaceInfo (Closed)
Patch Set: Cleanup offscreen canvas Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/compositor/test/no_transport_image_transport_factory.h " 5 #include "content/browser/compositor/test/no_transport_image_transport_factory.h "
6 #include "content/browser/renderer_host/offscreen_canvas_surface_impl.h" 6 #include "content/browser/renderer_host/offscreen_canvas_surface_impl.h"
7 #include "content/browser/renderer_host/offscreen_canvas_surface_manager.h" 7 #include "content/browser/renderer_host/offscreen_canvas_surface_manager.h"
8 #include "content/public/test/test_browser_thread.h" 8 #include "content/public/test/test_browser_thread.h"
9 #include "mojo/public/cpp/bindings/binding.h" 9 #include "mojo/public/cpp/bindings/binding.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 10 matching lines...) Expand all
21 21
22 class OffscreenCanvasSurfaceManagerTest : public testing::Test { 22 class OffscreenCanvasSurfaceManagerTest : public testing::Test {
23 public: 23 public:
24 int getNumSurfaceImplInstances() { 24 int getNumSurfaceImplInstances() {
25 return OffscreenCanvasSurfaceManager::GetInstance() 25 return OffscreenCanvasSurfaceManager::GetInstance()
26 ->registered_surface_instances_.size(); 26 ->registered_surface_instances_.size();
27 } 27 }
28 28
29 void OnSurfaceCreated(const cc::SurfaceId& surface_id) { 29 void OnSurfaceCreated(const cc::SurfaceId& surface_id) {
30 OffscreenCanvasSurfaceManager::GetInstance()->OnSurfaceCreated( 30 OffscreenCanvasSurfaceManager::GetInstance()->OnSurfaceCreated(
31 surface_id, gfx::Size(10, 10), 1.0); 31 cc::SurfaceInfo(surface_id, 1.0f, gfx::Size(10, 10)));
32 } 32 }
33 33
34 protected: 34 protected:
35 void SetUp() override; 35 void SetUp() override;
36 void TearDown() override; 36 void TearDown() override;
37 37
38 private: 38 private:
39 std::unique_ptr<TestBrowserThread> ui_thread_; 39 std::unique_ptr<TestBrowserThread> ui_thread_;
40 base::MessageLoopForUI message_loop_; 40 base::MessageLoopForUI message_loop_;
41 #if defined(OS_ANDROID) 41 #if defined(OS_ANDROID)
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 OffscreenCanvasSurfaceManager::GetInstance()->GetSurfaceInstance( 110 OffscreenCanvasSurfaceManager::GetInstance()->GetSurfaceInstance(
111 frame_sink_id_b)); 111 frame_sink_id_b));
112 112
113 surface_impl_a = nullptr; 113 surface_impl_a = nullptr;
114 EXPECT_EQ(1, this->getNumSurfaceImplInstances()); 114 EXPECT_EQ(1, this->getNumSurfaceImplInstances());
115 surface_impl_b = nullptr; 115 surface_impl_b = nullptr;
116 EXPECT_EQ(0, this->getNumSurfaceImplInstances()); 116 EXPECT_EQ(0, this->getNumSurfaceImplInstances());
117 } 117 }
118 118
119 } // namespace content 119 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698