OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <atlbase.h> | 5 #include <atlbase.h> |
6 #include <atlapp.h> | 6 #include <atlapp.h> |
7 #include <atlcrack.h> | 7 #include <atlcrack.h> |
8 #include <atlmisc.h> | 8 #include <atlmisc.h> |
9 #include <atlwin.h> | 9 #include <atlwin.h> |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 virtual ~MockWindowSubclass() { Die(); } | 90 virtual ~MockWindowSubclass() { Die(); } |
91 MOCK_METHOD0(Die, void()); | 91 MOCK_METHOD0(Die, void()); |
92 }; // class MockWindowSubclass | 92 }; // class MockWindowSubclass |
93 | 93 |
94 template<typename T> class MockDelegate | 94 template<typename T> class MockDelegate |
95 : public SubclassingWindowWithDelegate<T>::Delegate { | 95 : public SubclassingWindowWithDelegate<T>::Delegate { |
96 public: | 96 public: |
97 virtual ~MockDelegate() { Die(); } | 97 virtual ~MockDelegate() { Die(); } |
98 MOCK_METHOD0(Die, void()); | 98 MOCK_METHOD0(Die, void()); |
99 MOCK_METHOD1(AdjustDisplacedWindowDimensions, void(RECT* rect)); | 99 MOCK_METHOD1(AdjustDisplacedWindowDimensions, void(RECT* rect)); |
100 }; // class MockDelegate | 100 }; // clas MockDelegate |
101 | 101 |
102 template<typename T> T* Initialize(T* t, | 102 template<typename T> T* Initialize(T* t, |
103 HWND hwnd, | 103 HWND hwnd, |
104 typename T::Delegate* delegate) { | 104 typename T::Delegate* delegate) { |
105 if (t->Initialize(hwnd, delegate)) { | 105 if (t->Initialize(hwnd, delegate)) { |
106 return t; | 106 return t; |
107 } else { | 107 } else { |
108 delete t; | 108 delete t; |
109 return NULL; | 109 return NULL; |
110 } | 110 } |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 | 594 |
595 message_loop.RunFor(10); // seconds | 595 message_loop.RunFor(10); // seconds |
596 | 596 |
597 window.DestroyWindow(); | 597 window.DestroyWindow(); |
598 | 598 |
599 ASSERT_FALSE(message_loop.WasTimedOut()); | 599 ASSERT_FALSE(message_loop.WasTimedOut()); |
600 } | 600 } |
601 | 601 |
602 // TODO(erikwright): Write test for variations on return from default | 602 // TODO(erikwright): Write test for variations on return from default |
603 // OnNcCalcValidRects | 603 // OnNcCalcValidRects |
OLD | NEW |