Home | History | Annotate | Download | only in test
      1 // Copyright 2014 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef UI_OZONE_PLATFORM_DRI_TEST_MOCK_DRI_SURFACE_H_
      6 #define UI_OZONE_PLATFORM_DRI_TEST_MOCK_DRI_SURFACE_H_
      7 
      8 #include <vector>
      9 
     10 #include "ui/ozone/platform/dri/dri_surface.h"
     11 
     12 namespace gfx {
     13 class Size;
     14 }  // namespace gfx
     15 
     16 namespace ui {
     17 
     18 class DriBuffer;
     19 class DriWrapper;
     20 
     21 class MockDriSurface : public DriSurface {
     22  public:
     23   MockDriSurface(DriWrapper* dri, const gfx::Size& size);
     24   virtual ~MockDriSurface();
     25 
     26   const std::vector<ui::DriBuffer*>& bitmaps() const { return bitmaps_; }
     27   void set_initialize_expectation(bool state) {
     28     initialize_expectation_ = state;
     29   }
     30 
     31  private:
     32   // DriSurface:
     33   virtual ui::DriBuffer* CreateBuffer() OVERRIDE;
     34 
     35   DriWrapper* dri_;                  // Not owned.
     36   std::vector<DriBuffer*> bitmaps_;  // Not owned.
     37 
     38   bool initialize_expectation_;
     39 
     40   DISALLOW_COPY_AND_ASSIGN(MockDriSurface);
     41 };
     42 
     43 }  // namespace ui
     44 
     45 #endif  // UI_OZONE_PLATFORM_DRI_TEST_MOCK_DRI_SURFACE_H_
     46