OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/run_loop.h" | 5 #include "base/run_loop.h" |
6 #include "content/browser/aura/image_transport_factory.h" | 6 #include "content/browser/aura/image_transport_factory.h" |
7 #include "content/public/browser/gpu_data_manager.h" | 7 #include "content/public/browser/gpu_data_manager.h" |
8 #include "content/test/content_browser_test.h" | 8 #include "content/test/content_browser_test.h" |
9 #include "gpu/GLES2/gl2extchromium.h" | 9 #include "gpu/GLES2/gl2extchromium.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 scoped_refptr<ui::Texture> texture = factory->CreateTransportClient(1.f); | 40 scoped_refptr<ui::Texture> texture = factory->CreateTransportClient(1.f); |
41 ASSERT_TRUE(texture.get()); | 41 ASSERT_TRUE(texture.get()); |
42 | 42 |
43 MockImageTransportFactoryObserver observer; | 43 MockImageTransportFactoryObserver observer; |
44 factory->AddObserver(&observer); | 44 factory->AddObserver(&observer); |
45 | 45 |
46 base::RunLoop run_loop; | 46 base::RunLoop run_loop; |
47 EXPECT_CALL(observer, OnLostResources()) | 47 EXPECT_CALL(observer, OnLostResources()) |
48 .WillOnce(testing::InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); | 48 .WillOnce(testing::InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); |
49 | 49 |
50 WebKit::WebGraphicsContext3D* context = texture->HostContext3D(); | 50 blink::WebGraphicsContext3D* context = texture->HostContext3D(); |
51 context->loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB, | 51 context->loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB, |
52 GL_INNOCENT_CONTEXT_RESET_ARB); | 52 GL_INNOCENT_CONTEXT_RESET_ARB); |
53 | 53 |
54 run_loop.Run(); | 54 run_loop.Run(); |
55 EXPECT_FALSE(texture->HostContext3D()); | 55 EXPECT_FALSE(texture->HostContext3D()); |
56 EXPECT_EQ(0u, texture->PrepareTexture()); | 56 EXPECT_EQ(0u, texture->PrepareTexture()); |
57 | 57 |
58 factory->RemoveObserver(&observer); | 58 factory->RemoveObserver(&observer); |
59 } | 59 } |
60 | 60 |
61 } // anonymous namespace | 61 } // anonymous namespace |
62 } // namespace content | 62 } // namespace content |
OLD | NEW |