OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "components/exo/buffer.h" | 6 #include "components/exo/buffer.h" |
7 #include "components/exo/surface.h" | 7 #include "components/exo/surface.h" |
8 #include "components/exo/test/exo_test_base.h" | 8 #include "components/exo/test/exo_test_base.h" |
9 #include "components/exo/test/exo_test_helper.h" | 9 #include "components/exo/test/exo_test_helper.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
126 | 126 |
127 // This will update the bounds of the surface and take the viewport into | 127 // This will update the bounds of the surface and take the viewport into |
128 // account. | 128 // account. |
129 surface->Attach(buffer.get()); | 129 surface->Attach(buffer.get()); |
130 gfx::Size viewport(256, 256); | 130 gfx::Size viewport(256, 256); |
131 surface->SetViewport(viewport); | 131 surface->SetViewport(viewport); |
132 surface->Commit(); | 132 surface->Commit(); |
133 EXPECT_EQ(viewport.ToString(), surface->bounds().size().ToString()); | 133 EXPECT_EQ(viewport.ToString(), surface->bounds().size().ToString()); |
134 } | 134 } |
135 | 135 |
136 TEST_F(SurfaceTest, SetOnlyVisibleOnSecureOutput) { | |
137 gfx::Size buffer_size(1, 1); | |
138 scoped_ptr<Buffer> buffer( | |
139 new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); | |
140 scoped_ptr<Surface> surface(new Surface); | |
141 | |
142 surface->Attach(buffer.get()); | |
143 surface->SetOnlyVisibleOnSecureOutput(true); | |
144 surface->Commit(); | |
Daniele Castagna
2016/03/16 22:28:07
Test that the produced mailbox has the flag secure
reveman
2016/03/17 16:36:32
Done.
| |
145 } | |
146 | |
136 TEST_F(SurfaceTest, Commit) { | 147 TEST_F(SurfaceTest, Commit) { |
137 scoped_ptr<Surface> surface(new Surface); | 148 scoped_ptr<Surface> surface(new Surface); |
138 | 149 |
139 // Calling commit without a buffer should succeed. | 150 // Calling commit without a buffer should succeed. |
140 surface->Commit(); | 151 surface->Commit(); |
141 } | 152 } |
142 | 153 |
143 } // namespace | 154 } // namespace |
144 } // namespace exo | 155 } // namespace exo |
OLD | NEW |