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

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: fix mac compile 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 2311 matching lines...) Expand 10 before | Expand all | Expand 10 after
2322 2322
2323 // No custom icon set. Acitivating windows should not change icon. 2323 // No custom icon set. Acitivating windows should not change icon.
2324 EXPECT_FALSE(item_delegate->image_set_by_controller()); 2324 EXPECT_FALSE(item_delegate->image_set_by_controller());
2325 window1->Activate(); 2325 window1->Activate();
2326 EXPECT_FALSE(item_delegate->image_set_by_controller()); 2326 EXPECT_FALSE(item_delegate->image_set_by_controller());
2327 window2->Activate(); 2327 window2->Activate();
2328 EXPECT_FALSE(item_delegate->image_set_by_controller()); 2328 EXPECT_FALSE(item_delegate->image_set_by_controller());
2329 2329
2330 // Set custom icon on active item. Icon should change to custom. 2330 // Set custom icon on active item. Icon should change to custom.
2331 arc_test_.app_instance()->SendTaskDescription(2, std::string(), png_data); 2331 arc_test_.app_instance()->SendTaskDescription(2, std::string(), png_data);
2332 base::RunLoop().RunUntilIdle();
2332 EXPECT_TRUE(item_delegate->image_set_by_controller()); 2333 EXPECT_TRUE(item_delegate->image_set_by_controller());
2333 2334
2334 // Switch back to the item without custom icon. Icon should be changed to 2335 // Switch back to the item without custom icon. Icon should be changed to
2335 // default. 2336 // default.
2336 window1->Activate(); 2337 window1->Activate();
2337 EXPECT_FALSE(item_delegate->image_set_by_controller()); 2338 EXPECT_FALSE(item_delegate->image_set_by_controller());
2338 // Test that setting an invalid icon should not change custom icon. 2339 // Test that setting an invalid icon should not change custom icon.
2339 arc_test_.app_instance()->SendTaskDescription(1, std::string(), png_data); 2340 arc_test_.app_instance()->SendTaskDescription(1, std::string(), png_data);
2340 EXPECT_TRUE(item_delegate->image_set_by_controller()); 2341 EXPECT_TRUE(item_delegate->image_set_by_controller());
2341 arc_test_.app_instance()->SendTaskDescription(1, std::string(), 2342 arc_test_.app_instance()->SendTaskDescription(1, std::string(),
(...skipping 1948 matching lines...) Expand 10 before | Expand all | Expand 10 after
4290 EXPECT_EQ(3u, shelf_controller->added_count()); 4291 EXPECT_EQ(3u, shelf_controller->added_count());
4291 EXPECT_EQ(1u, shelf_controller->removed_count()); 4292 EXPECT_EQ(1u, shelf_controller->removed_count());
4292 4293
4293 // Remove an item from Chrome's model; ShelfController should be notified. 4294 // Remove an item from Chrome's model; ShelfController should be notified.
4294 model_.RemoveItemAt(2); 4295 model_.RemoveItemAt(2);
4295 EXPECT_EQ(2, model_.item_count()); 4296 EXPECT_EQ(2, model_.item_count());
4296 base::RunLoop().RunUntilIdle(); 4297 base::RunLoop().RunUntilIdle();
4297 EXPECT_EQ(3u, shelf_controller->added_count()); 4298 EXPECT_EQ(3u, shelf_controller->added_count());
4298 EXPECT_EQ(2u, shelf_controller->removed_count()); 4299 EXPECT_EQ(2u, shelf_controller->removed_count());
4299 } 4300 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698