| 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 // Note: This test depends on |GlHelper|, which depends on an implementation of |    5 // Note: This test depends on |GlHelper|, which depends on an implementation of | 
|    6 // mojo:native_viewport_service and mojo:surfaces_service. |    6 // mojo:native_viewport_service and mojo:surfaces_service. | 
|    7  |    7  | 
|    8 #include "apps/moterm/gl_helper.h" |    8 #include "apps/moterm/gl_helper.h" | 
|    9  |    9  | 
|   10 #include <GLES2/gl2.h> |   10 #include <GLES2/gl2.h> | 
|   11  |   11  | 
|   12 #include "base/logging.h" |   12 #include "base/logging.h" | 
|   13 #include "base/macros.h" |   13 #include "base/macros.h" | 
|   14 #include "base/memory/scoped_ptr.h" |   14 #include "base/memory/scoped_ptr.h" | 
|   15 #include "base/message_loop/message_loop.h" |   15 #include "base/message_loop/message_loop.h" | 
|   16 #include "mojo/public/cpp/application/application_impl.h" |   16 #include "mojo/public/cpp/application/application_impl.h" | 
|   17 #include "mojo/public/cpp/application/application_test_base.h" |   17 #include "mojo/public/cpp/application/application_test_base.h" | 
|   18 #include "mojo/services/surfaces/public/interfaces/surface_id.mojom.h" |   18 #include "mojo/services/surfaces/interfaces/surface_id.mojom.h" | 
|   19 #include "testing/gtest/include/gtest/gtest.h" |   19 #include "testing/gtest/include/gtest/gtest.h" | 
|   20  |   20  | 
|   21 namespace { |   21 namespace { | 
|   22  |   22  | 
|   23 class GlHelperTest : public mojo::test::ApplicationTestBase, |   23 class GlHelperTest : public mojo::test::ApplicationTestBase, | 
|   24                      public GlHelper::Client { |   24                      public GlHelper::Client { | 
|   25  public: |   25  public: | 
|   26   GlHelperTest() |   26   GlHelperTest() | 
|   27       : surface_id_changed_call_count_(0), |   27       : surface_id_changed_call_count_(0), | 
|   28         on_frame_displayed_call_count_(0), |   28         on_frame_displayed_call_count_(0), | 
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  160   EXPECT_EQ(surface_id.id_namespace, last_surface_id()->id_namespace); |  160   EXPECT_EQ(surface_id.id_namespace, last_surface_id()->id_namespace); | 
|  161   EXPECT_EQ(2u, on_frame_displayed_call_count()); |  161   EXPECT_EQ(2u, on_frame_displayed_call_count()); | 
|  162   EXPECT_EQ(frame_id, last_frame_id()); |  162   EXPECT_EQ(frame_id, last_frame_id()); | 
|  163  |  163  | 
|  164   // An out-of-the-blue |MakeCurrent()| should work. |  164   // An out-of-the-blue |MakeCurrent()| should work. | 
|  165   gl_helper()->MakeCurrent(); |  165   gl_helper()->MakeCurrent(); | 
|  166   EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); |  166   EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError()); | 
|  167 } |  167 } | 
|  168  |  168  | 
|  169 }  // namespace |  169 }  // namespace | 
| OLD | NEW |