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

Side by Side Diff: chrome/browser/chromeos/display/display_preferences_unittest.cc

Issue 324583002: The 1st patch to disambiguate message center notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 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 (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/chromeos/display/display_preferences.h" 5 #include "chrome/browser/chromeos/display/display_preferences.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/display/display_controller.h" 10 #include "ash/display/display_controller.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 const base::DictionaryValue* property = NULL; 434 const base::DictionaryValue* property = NULL;
435 EXPECT_TRUE(properties->GetDictionary(base::Int64ToString(id), &property)); 435 EXPECT_TRUE(properties->GetDictionary(base::Int64ToString(id), &property));
436 int width = 0, height = 0; 436 int width = 0, height = 0;
437 EXPECT_FALSE(property->GetInteger("width", &width)); 437 EXPECT_FALSE(property->GetInteger("width", &width));
438 EXPECT_FALSE(property->GetInteger("height", &height)); 438 EXPECT_FALSE(property->GetInteger("height", &height));
439 439
440 // Revert the change. When timeout, 2nd button is revert. 440 // Revert the change. When timeout, 2nd button is revert.
441 message_center::MessageCenter::Get()->ClickOnNotificationButton( 441 message_center::MessageCenter::Get()->ClickOnNotificationButton(
442 ResolutionNotificationController::kNotificationId, 1); 442 ResolutionNotificationController::kNotificationId, 1);
443 RunAllPendingInMessageLoop(); 443 RunAllPendingInMessageLoop();
444 EXPECT_FALSE(message_center::MessageCenter::Get()->HasNotification( 444 EXPECT_FALSE(
445 ResolutionNotificationController::kNotificationId)); 445 message_center::MessageCenter::Get()->FindVisibleNotificationById(
446 ResolutionNotificationController::kNotificationId));
446 447
447 // Once the notification is removed, the specified resolution will be stored 448 // Once the notification is removed, the specified resolution will be stored
448 // by SetDisplayResolution. 449 // by SetDisplayResolution.
449 ash::Shell::GetInstance()->display_manager()->SetDisplayResolution( 450 ash::Shell::GetInstance()->display_manager()->SetDisplayResolution(
450 id, gfx::Size(300, 200)); 451 id, gfx::Size(300, 200));
451 UpdateDisplay("300x200#500x400|400x300|300x200"); 452 UpdateDisplay("300x200#500x400|400x300|300x200");
452 453
453 property = NULL; 454 property = NULL;
454 EXPECT_TRUE(properties->GetDictionary(base::Int64ToString(id), &property)); 455 EXPECT_TRUE(properties->GetDictionary(base::Int64ToString(id), &property));
455 EXPECT_TRUE(property->GetInteger("width", &width)); 456 EXPECT_TRUE(property->GetInteger("width", &width));
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 local_state()->GetDictionary(prefs::kDisplayProperties); 657 local_state()->GetDictionary(prefs::kDisplayProperties);
657 const base::DictionaryValue* property = NULL; 658 const base::DictionaryValue* property = NULL;
658 EXPECT_TRUE(properties->GetDictionary( 659 EXPECT_TRUE(properties->GetDictionary(
659 base::Int64ToString(gfx::Display::InternalDisplayId()), &property)); 660 base::Int64ToString(gfx::Display::InternalDisplayId()), &property));
660 int rotation = -1; 661 int rotation = -1;
661 EXPECT_TRUE(property->GetInteger("rotation", &rotation)); 662 EXPECT_TRUE(property->GetInteger("rotation", &rotation));
662 EXPECT_EQ(gfx::Display::ROTATE_0, rotation); 663 EXPECT_EQ(gfx::Display::ROTATE_0, rotation);
663 } 664 }
664 665
665 } // namespace chromeos 666 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698