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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc

Issue 2900783003: Handle app custom icon via aura::Window property. (Closed)
Patch Set: nits, discard owner from _item_controller, make SetAppIcon non-static Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chrome_launcher_controller.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 2318 matching lines...) Expand 10 before | Expand all | Expand 10 after
2329 2329
2330 // No custom icon set. Acitivating windows should not change icon. 2330 // No custom icon set. Acitivating windows should not change icon.
2331 EXPECT_FALSE(item_delegate->image_set_by_controller()); 2331 EXPECT_FALSE(item_delegate->image_set_by_controller());
2332 window1->Activate(); 2332 window1->Activate();
2333 EXPECT_FALSE(item_delegate->image_set_by_controller()); 2333 EXPECT_FALSE(item_delegate->image_set_by_controller());
2334 window2->Activate(); 2334 window2->Activate();
2335 EXPECT_FALSE(item_delegate->image_set_by_controller()); 2335 EXPECT_FALSE(item_delegate->image_set_by_controller());
2336 2336
2337 // Set custom icon on active item. Icon should change to custom. 2337 // Set custom icon on active item. Icon should change to custom.
2338 arc_test_.app_instance()->SendTaskDescription(2, std::string(), png_data); 2338 arc_test_.app_instance()->SendTaskDescription(2, std::string(), png_data);
2339 base::RunLoop().RunUntilIdle();
2339 EXPECT_TRUE(item_delegate->image_set_by_controller()); 2340 EXPECT_TRUE(item_delegate->image_set_by_controller());
2340 2341
2341 // Switch back to the item without custom icon. Icon should be changed to 2342 // Switch back to the item without custom icon. Icon should be changed to
2342 // default. 2343 // default.
2343 window1->Activate(); 2344 window1->Activate();
2344 EXPECT_FALSE(item_delegate->image_set_by_controller()); 2345 EXPECT_FALSE(item_delegate->image_set_by_controller());
2345 // Test that setting an invalid icon should not change custom icon. 2346 // Test that setting an invalid icon should not change custom icon.
2346 arc_test_.app_instance()->SendTaskDescription(1, std::string(), png_data); 2347 arc_test_.app_instance()->SendTaskDescription(1, std::string(), png_data);
2347 EXPECT_TRUE(item_delegate->image_set_by_controller()); 2348 EXPECT_TRUE(item_delegate->image_set_by_controller());
2348 arc_test_.app_instance()->SendTaskDescription(1, std::string(), 2349 arc_test_.app_instance()->SendTaskDescription(1, std::string(),
(...skipping 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after
4285 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS, 4286 EXPECT_EQ(ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS,
4286 shelf_controller->auto_hide()); 4287 shelf_controller->auto_hide());
4287 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count()); 4288 EXPECT_EQ(2u, shelf_controller->auto_hide_change_count());
4288 4289
4289 PrefService* prefs = profile()->GetTestingPrefService(); 4290 PrefService* prefs = profile()->GetTestingPrefService();
4290 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal)); 4291 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignmentLocal));
4291 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment)); 4292 EXPECT_EQ("Left", prefs->GetString(prefs::kShelfAlignment));
4292 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal)); 4293 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehaviorLocal));
4293 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior)); 4294 EXPECT_EQ("Always", prefs->GetString(prefs::kShelfAutoHideBehavior));
4294 } 4295 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698