| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/ash/launcher/browser_launcher_item_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> |
| 9 | 10 |
| 10 #include "ash/launcher/launcher_model.h" | 11 #include "ash/launcher/launcher_model.h" |
| 11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 12 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 13 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 13 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 14 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 15 #include "chrome/browser/ui/tabs/test_tab_strip_model_delegate.h" | 16 #include "chrome/browser/ui/tabs/test_tab_strip_model_delegate.h" |
| 16 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 17 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 17 #include "chrome/test/base/testing_profile.h" | 18 #include "chrome/test/base/testing_profile.h" |
| 18 #include "content/public/test/test_browser_thread.h" | 19 #include "content/public/test/test_browser_thread.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 int GetAndClearFetchCount() { | 89 int GetAndClearFetchCount() { |
| 89 int value = fetch_count_; | 90 int value = fetch_count_; |
| 90 fetch_count_ = 0; | 91 fetch_count_ = 0; |
| 91 return value; | 92 return value; |
| 92 } | 93 } |
| 93 | 94 |
| 94 // AppIconLoader implementation: | 95 // AppIconLoader implementation: |
| 95 virtual void FetchImage(const std::string& id) OVERRIDE { | 96 virtual void FetchImage(const std::string& id) OVERRIDE { |
| 96 fetch_count_++; | 97 fetch_count_++; |
| 97 } | 98 } |
| 99 virtual void ClearImage(const std::string& id) OVERRIDE { |
| 100 } |
| 98 | 101 |
| 99 private: | 102 private: |
| 100 int fetch_count_; | 103 int fetch_count_; |
| 101 | 104 |
| 102 DISALLOW_COPY_AND_ASSIGN(AppIconLoaderImpl); | 105 DISALLOW_COPY_AND_ASSIGN(AppIconLoaderImpl); |
| 103 }; | 106 }; |
| 104 | 107 |
| 105 } // namespace | 108 } // namespace |
| 106 | 109 |
| 107 class BrowserLauncherItemControllerTest : | 110 class BrowserLauncherItemControllerTest |
| 108 public ChromeRenderViewHostTestHarness { | 111 : public ChromeRenderViewHostTestHarness { |
| 109 public: | 112 public: |
| 110 BrowserLauncherItemControllerTest() | 113 BrowserLauncherItemControllerTest() |
| 111 : browser_thread_(content::BrowserThread::UI, &message_loop_) { | 114 : browser_thread_(content::BrowserThread::UI, &message_loop_) { |
| 112 } | 115 } |
| 113 | 116 |
| 114 virtual void SetUp() OVERRIDE { | 117 virtual void SetUp() OVERRIDE { |
| 115 ChromeRenderViewHostTestHarness::SetUp(); | 118 ChromeRenderViewHostTestHarness::SetUp(); |
| 116 | 119 |
| 117 activation_client_.reset( | 120 activation_client_.reset( |
| 118 new aura::test::TestActivationClient(root_window())); | 121 new aura::test::TestActivationClient(root_window())); |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 EXPECT_EQ(ash::STATUS_RUNNING, app_state.GetUpdaterItem().status); | 433 EXPECT_EQ(ash::STATUS_RUNNING, app_state.GetUpdaterItem().status); |
| 431 | 434 |
| 432 // App window should go to attention state. | 435 // App window should go to attention state. |
| 433 app_state.window.SetProperty(aura::client::kDrawAttentionKey, true); | 436 app_state.window.SetProperty(aura::client::kDrawAttentionKey, true); |
| 434 EXPECT_EQ(ash::STATUS_ATTENTION, app_state.GetUpdaterItem().status); | 437 EXPECT_EQ(ash::STATUS_ATTENTION, app_state.GetUpdaterItem().status); |
| 435 | 438 |
| 436 // Activating app window should clear attention state. | 439 // Activating app window should clear attention state. |
| 437 activation_client_->ActivateWindow(&app_state.window); | 440 activation_client_->ActivateWindow(&app_state.window); |
| 438 EXPECT_EQ(ash::STATUS_ACTIVE, app_state.GetUpdaterItem().status); | 441 EXPECT_EQ(ash::STATUS_ACTIVE, app_state.GetUpdaterItem().status); |
| 439 } | 442 } |
| OLD | NEW |