| 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/chromeos/display/display_preferences.h" | 5 #include "chrome/browser/chromeos/display/display_preferences.h" |
| 6 | 6 |
| 7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
| 8 #include "ash/display/display_layout_store.h" | 8 #include "ash/display/display_layout_store.h" |
| 9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
| 10 #include "ash/display/resolution_notification_controller.h" | 10 #include "ash/display/resolution_notification_controller.h" |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 const base::DictionaryValue* property = NULL; | 431 const base::DictionaryValue* property = NULL; |
| 432 EXPECT_TRUE(properties->GetDictionary(base::Int64ToString(id), &property)); | 432 EXPECT_TRUE(properties->GetDictionary(base::Int64ToString(id), &property)); |
| 433 int width = 0, height = 0; | 433 int width = 0, height = 0; |
| 434 EXPECT_FALSE(property->GetInteger("width", &width)); | 434 EXPECT_FALSE(property->GetInteger("width", &width)); |
| 435 EXPECT_FALSE(property->GetInteger("height", &height)); | 435 EXPECT_FALSE(property->GetInteger("height", &height)); |
| 436 | 436 |
| 437 // Revert the change. When timeout, 2nd button is revert. | 437 // Revert the change. When timeout, 2nd button is revert. |
| 438 message_center::MessageCenter::Get()->ClickOnNotificationButton( | 438 message_center::MessageCenter::Get()->ClickOnNotificationButton( |
| 439 ResolutionNotificationController::kNotificationId, 1); | 439 ResolutionNotificationController::kNotificationId, 1); |
| 440 RunAllPendingInMessageLoop(); | 440 RunAllPendingInMessageLoop(); |
| 441 EXPECT_FALSE(message_center::MessageCenter::Get()->HasNotification( | 441 EXPECT_TRUE(message_center::MessageCenter::Get()->FindVisibleNotificationById( |
| 442 ResolutionNotificationController::kNotificationId)); | 442 ResolutionNotificationController::kNotificationId) == NULL); |
| 443 | 443 |
| 444 // Once the notification is removed, the specified resolution will be stored | 444 // Once the notification is removed, the specified resolution will be stored |
| 445 // by SetDisplayResolution. | 445 // by SetDisplayResolution. |
| 446 ash::Shell::GetInstance()->display_manager()->SetDisplayResolution( | 446 ash::Shell::GetInstance()->display_manager()->SetDisplayResolution( |
| 447 id, gfx::Size(300, 200)); | 447 id, gfx::Size(300, 200)); |
| 448 UpdateDisplay("300x200#500x400|400x300|300x200"); | 448 UpdateDisplay("300x200#500x400|400x300|300x200"); |
| 449 | 449 |
| 450 property = NULL; | 450 property = NULL; |
| 451 EXPECT_TRUE(properties->GetDictionary(base::Int64ToString(id), &property)); | 451 EXPECT_TRUE(properties->GetDictionary(base::Int64ToString(id), &property)); |
| 452 EXPECT_TRUE(property->GetInteger("width", &width)); | 452 EXPECT_TRUE(property->GetInteger("width", &width)); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 local_state()->GetDictionary(prefs::kDisplayProperties); | 653 local_state()->GetDictionary(prefs::kDisplayProperties); |
| 654 const base::DictionaryValue* property = NULL; | 654 const base::DictionaryValue* property = NULL; |
| 655 EXPECT_TRUE(properties->GetDictionary( | 655 EXPECT_TRUE(properties->GetDictionary( |
| 656 base::Int64ToString(gfx::Display::InternalDisplayId()), &property)); | 656 base::Int64ToString(gfx::Display::InternalDisplayId()), &property)); |
| 657 int rotation = -1; | 657 int rotation = -1; |
| 658 EXPECT_TRUE(property->GetInteger("rotation", &rotation)); | 658 EXPECT_TRUE(property->GetInteger("rotation", &rotation)); |
| 659 EXPECT_EQ(gfx::Display::ROTATE_0, rotation); | 659 EXPECT_EQ(gfx::Display::ROTATE_0, rotation); |
| 660 } | 660 } |
| 661 | 661 |
| 662 } // namespace chromeos | 662 } // namespace chromeos |
| OLD | NEW |