| 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 "chrome/browser/chromeos/status/network_menu_icon.h" | 5 #include "chrome/browser/chromeos/status/network_menu_icon.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/cros/cros_library.h" | 7 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 8 #include "chrome/test/base/testing_browser_process.h" | 8 #include "chrome/test/base/testing_browser_process.h" |
| 9 #include "grit/theme_resources.h" | 9 #include "grit/theme_resources.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 SetRoamingState(network, ROAMING_STATE_HOME); | 231 SetRoamingState(network, ROAMING_STATE_HOME); |
| 232 icon = NetworkMenuIcon::GetBitmap(network); | 232 icon = NetworkMenuIcon::GetBitmap(network); |
| 233 EXPECT_TRUE(CompareBitmaps(icon, cellular_disconnected_bitmap_)); | 233 EXPECT_TRUE(CompareBitmaps(icon, cellular_disconnected_bitmap_)); |
| 234 } | 234 } |
| 235 | 235 |
| 236 namespace { | 236 namespace { |
| 237 | 237 |
| 238 class TestNetworkMenuIcon : public NetworkMenuIcon { | 238 class TestNetworkMenuIcon : public NetworkMenuIcon { |
| 239 public: | 239 public: |
| 240 explicit TestNetworkMenuIcon(Mode mode) | 240 explicit TestNetworkMenuIcon(Mode mode) |
| 241 : NetworkMenuIcon(&delegate_, mode), | 241 : NetworkMenuIcon(&delegate_, mode, TYPE_WIFI), |
| 242 animation_(0.0) { | 242 animation_(0.0) { |
| 243 } | 243 } |
| 244 virtual ~TestNetworkMenuIcon() {} | 244 virtual ~TestNetworkMenuIcon() {} |
| 245 | 245 |
| 246 // NetworkMenuIcon override. | 246 // NetworkMenuIcon override. |
| 247 virtual double GetAnimation() OVERRIDE { return animation_; } | 247 virtual double GetAnimation() OVERRIDE { return animation_; } |
| 248 | 248 |
| 249 void set_animation(double animation) { animation_ = animation; } | 249 void set_animation(double animation) { animation_ = animation; } |
| 250 | 250 |
| 251 private: | 251 private: |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 icon = menu_icon.GetIconAndText(NULL); | 332 icon = menu_icon.GetIconAndText(NULL); |
| 333 EXPECT_TRUE(CompareBitmaps(icon, wifi_connecting_bitmap_)); | 333 EXPECT_TRUE(CompareBitmaps(icon, wifi_connecting_bitmap_)); |
| 334 | 334 |
| 335 // Set wifi1 to connected. Icon should now be wifi connected icon. | 335 // Set wifi1 to connected. Icon should now be wifi connected icon. |
| 336 SetConnected(wifi1, true); | 336 SetConnected(wifi1, true); |
| 337 icon = menu_icon.GetIconAndText(NULL); | 337 icon = menu_icon.GetIconAndText(NULL); |
| 338 EXPECT_TRUE(CompareBitmaps(icon, wifi_connected_100_bitmap_)); | 338 EXPECT_TRUE(CompareBitmaps(icon, wifi_connected_100_bitmap_)); |
| 339 } | 339 } |
| 340 | 340 |
| 341 } // namespace chromeos | 341 } // namespace chromeos |
| OLD | NEW |