| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/gtk/go_button_gtk.h" | 5 #include "chrome/browser/gtk/go_button_gtk.h" |
| 6 #include "base/task.h" | 6 #include "base/task.h" |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 class GoButtonGtkPeer { | 9 class GoButtonGtkPeer { |
| 10 public: | 10 public: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 GoButtonGtk* const go_; | 38 GoButtonGtk* const go_; |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 namespace { | 41 namespace { |
| 42 | 42 |
| 43 class GoButtonGtkTest : public testing::Test { | 43 class GoButtonGtkTest : public testing::Test { |
| 44 protected: | 44 protected: |
| 45 GoButtonGtkTest() : go_(NULL), peer_(&go_) { } | 45 GoButtonGtkTest() : go_(NULL, NULL), peer_(&go_) { } |
| 46 | 46 |
| 47 protected: | 47 protected: |
| 48 GoButtonGtk go_; | 48 GoButtonGtk go_; |
| 49 GoButtonGtkPeer peer_; | 49 GoButtonGtkPeer peer_; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 TEST_F(GoButtonGtkTest, ChangeModeGo) { | 52 TEST_F(GoButtonGtkTest, ChangeModeGo) { |
| 53 go_.ChangeMode(GoButtonGtk::MODE_GO); | 53 go_.ChangeMode(GoButtonGtk::MODE_GO); |
| 54 EXPECT_EQ(GoButtonGtk::MODE_GO, peer_.intended_mode()); | 54 EXPECT_EQ(GoButtonGtk::MODE_GO, peer_.intended_mode()); |
| 55 EXPECT_EQ(GoButtonGtk::MODE_GO, peer_.visible_mode()); | 55 EXPECT_EQ(GoButtonGtk::MODE_GO, peer_.visible_mode()); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 | 122 |
| 123 TEST_F(GoButtonGtkTest, OnClickedStop) { | 123 TEST_F(GoButtonGtkTest, OnClickedStop) { |
| 124 peer_.set_visible_mode(GoButtonGtk::MODE_STOP); | 124 peer_.set_visible_mode(GoButtonGtk::MODE_STOP); |
| 125 EXPECT_TRUE(peer_.OnClicked()); | 125 EXPECT_TRUE(peer_.OnClicked()); |
| 126 EXPECT_EQ(GoButtonGtk::MODE_GO, peer_.visible_mode()); | 126 EXPECT_EQ(GoButtonGtk::MODE_GO, peer_.visible_mode()); |
| 127 EXPECT_EQ(GoButtonGtk::MODE_GO, peer_.intended_mode()); | 127 EXPECT_EQ(GoButtonGtk::MODE_GO, peer_.intended_mode()); |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace | 130 } // namespace |
| OLD | NEW |