Make sure webrtc::VideoSource is released when WebRtcVideoTrackAdapter is destroyed.
[chromium-blink-merge.git] / ui / views / test / test_views.h
blob7d0cabf6c8ae1d5dc5104bf89eecfe88a2217ca9
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
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_TEST_TEST_VIEWS_H_
6 #define UI_VIEWS_TEST_TEST_VIEWS_H_
8 #include "ui/views/view.h"
10 namespace views {
12 // A view that requests a set amount of space.
13 class StaticSizedView : public View {
14 public:
15 explicit StaticSizedView(const gfx::Size& size);
16 virtual ~StaticSizedView();
18 virtual gfx::Size GetPreferredSize() const OVERRIDE;
20 private:
21 gfx::Size size_;
23 DISALLOW_COPY_AND_ASSIGN(StaticSizedView);
26 // A view that accomodates testing layouts that use GetHeightForWidth.
27 class ProportionallySizedView : public View {
28 public:
29 explicit ProportionallySizedView(int factor);
30 virtual ~ProportionallySizedView();
32 virtual int GetHeightForWidth(int w) const OVERRIDE;
34 private:
35 // The multiplicative factor between width and height, i.e.
36 // height = width * factor_.
37 int factor_;
39 DISALLOW_COPY_AND_ASSIGN(ProportionallySizedView);
42 } // namespace views
44 #endif // UI_VIEWS_TEST_TEST_VIEWS_H_