Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Unified Diff: chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller_unittest.cc

Issue 10392173: Flash window by pulsing their launcher icon state indicator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Some cleanup Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller_unittest.cc
diff --git a/chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller_unittest.cc b/chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller_unittest.cc
index bf057452fee1aa182af493966a8a0ce60e0b9dc0..86b75c0beeb73dd8b08175b18bbc1fac6dce0c3c 100644
--- a/chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller_unittest.cc
+++ b/chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller_unittest.cc
@@ -18,6 +18,7 @@
#include "content/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/activation_delegate.h"
#include "ui/aura/root_window.h"
#include "ui/aura/test/test_activation_client.h"
@@ -362,3 +363,29 @@ TEST_F(BrowserLauncherItemControllerTest, SwitchDirectlyToApp) {
EXPECT_EQ(ash::STATUS_ACTIVE, launcher_model_->items()[index2].status);
EXPECT_EQ(&state2.window, activation_client_->GetActiveWindow());
}
+
+// Test attention states of windows.
+TEST_F(BrowserLauncherItemControllerTest, FlashWindow) {
+ // App panel first
+ State app_state(this, "1", BrowserLauncherItemController::TYPE_APP_PANEL);
+ EXPECT_EQ(ash::STATUS_ACTIVE, app_state.GetUpdaterItem().status);
+
+ // Active windows don't show attention.
+ app_state.window.SetProperty(aura::client::kDrawAttentionKey, true);
+ EXPECT_EQ(ash::STATUS_ACTIVE, app_state.GetUpdaterItem().status);
+
+ // Then browser window
+ State browser_state(
+ this, std::string(), BrowserLauncherItemController::TYPE_TABBED);
+ // First browser is active.
+ EXPECT_EQ(ash::STATUS_ACTIVE, browser_state.GetUpdaterItem().status);
+ EXPECT_EQ(ash::STATUS_RUNNING, app_state.GetUpdaterItem().status);
+
+ // App window should go to attention state.
+ app_state.window.SetProperty(aura::client::kDrawAttentionKey, true);
+ EXPECT_EQ(ash::STATUS_ATTENTION, app_state.GetUpdaterItem().status);
+
+ // Activating app window should clear attention state.
+ activation_client_->ActivateWindow(&app_state.window);
+ EXPECT_EQ(ash::STATUS_ACTIVE, app_state.GetUpdaterItem().status);
+}

Powered by Google App Engine
This is Rietveld 408576698