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 | 9 |
10 #include "ash/launcher/launcher_model.h" | 10 #include "ash/launcher/launcher_model.h" |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 app_tab_helper_->SetAppID(panel_tab.get(), "1"); // Panels are apps. | 314 app_tab_helper_->SetAppID(panel_tab.get(), "1"); // Panels are apps. |
315 tab_strip.InsertWebContentsAt(0, | 315 tab_strip.InsertWebContentsAt(0, |
316 panel_tab.get(), | 316 panel_tab.get(), |
317 TabStripModel::ADD_ACTIVE); | 317 TabStripModel::ADD_ACTIVE); |
318 BrowserLauncherItemController updater( | 318 BrowserLauncherItemController updater( |
319 LauncherItemController::TYPE_EXTENSION_PANEL, | 319 LauncherItemController::TYPE_EXTENSION_PANEL, |
320 &window, &tab_strip, launcher_delegate_.get(), | 320 &window, &tab_strip, launcher_delegate_.get(), |
321 std::string()); | 321 std::string()); |
322 updater.Init(); | 322 updater.Init(); |
323 ASSERT_EQ(initial_size + 1, launcher_model_->items().size()); | 323 ASSERT_EQ(initial_size + 1, launcher_model_->items().size()); |
324 EXPECT_EQ(ash::TYPE_APP_PANEL, GetItem(&updater).type); | 324 EXPECT_EQ(ash::TYPE_PLATFORM_APP, GetItem(&updater).type); |
325 EXPECT_NE(static_cast<void*>(NULL), updater.favicon_loader_.get()); | 325 EXPECT_NE(static_cast<void*>(NULL), updater.favicon_loader_.get()); |
326 } | 326 } |
327 } | 327 } |
328 | 328 |
329 // Verifies pinned apps are persisted and restored. | 329 // Verifies pinned apps are persisted and restored. |
330 TEST_F(BrowserLauncherItemControllerTest, PersistPinned) { | 330 TEST_F(BrowserLauncherItemControllerTest, PersistPinned) { |
331 size_t initial_size = launcher_model_->items().size(); | 331 size_t initial_size = launcher_model_->items().size(); |
332 scoped_ptr<content::WebContents> tab1(CreateTestWebContents()); | 332 scoped_ptr<content::WebContents> tab1(CreateTestWebContents()); |
333 | 333 |
334 app_tab_helper_->SetAppID(tab1.get(), "1"); | 334 app_tab_helper_->SetAppID(tab1.get(), "1"); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 EXPECT_EQ(ash::STATUS_RUNNING, app_state.GetUpdaterItem().status); | 441 EXPECT_EQ(ash::STATUS_RUNNING, app_state.GetUpdaterItem().status); |
442 | 442 |
443 // App window should go to attention state. | 443 // App window should go to attention state. |
444 app_state.window.SetProperty(aura::client::kDrawAttentionKey, true); | 444 app_state.window.SetProperty(aura::client::kDrawAttentionKey, true); |
445 EXPECT_EQ(ash::STATUS_ATTENTION, app_state.GetUpdaterItem().status); | 445 EXPECT_EQ(ash::STATUS_ATTENTION, app_state.GetUpdaterItem().status); |
446 | 446 |
447 // Activating app window should clear attention state. | 447 // Activating app window should clear attention state. |
448 activation_client_->ActivateWindow(&app_state.window); | 448 activation_client_->ActivateWindow(&app_state.window); |
449 EXPECT_EQ(ash::STATUS_ACTIVE, app_state.GetUpdaterItem().status); | 449 EXPECT_EQ(ash::STATUS_ACTIVE, app_state.GetUpdaterItem().status); |
450 } | 450 } |
OLD | NEW |