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

Unified Diff: ash/wm/overview/window_selector_unittest.cc

Issue 331643004: Update the window labels if they change in overview mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits. 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 side-by-side diff with in-line comments
Download patch
Index: ash/wm/overview/window_selector_unittest.cc
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc
index d552d7856e1b8de6b6d7edfb911fdca12819c0f2..82d05e743248aa5a49c2e643873ceb571e5af7cb 100644
--- a/ash/wm/overview/window_selector_unittest.cc
+++ b/ash/wm/overview/window_selector_unittest.cc
@@ -734,7 +734,7 @@ TEST_F(WindowSelectorTest, DISABLED_DragDropInProgress) {
TEST_F(WindowSelectorTest, CreateLabelUnderWindow) {
scoped_ptr<aura::Window> window(CreateWindow(gfx::Rect(0, 0, 100, 100)));
base::string16 window_title = base::UTF8ToUTF16("My window");
- window->set_title(window_title);
+ window->SetTitle(window_title);
ToggleOverview();
WindowSelectorItem* window_item = GetWindowItemsForRoot(0).back();
views::Widget* widget = GetLabelWidget(window_item);
@@ -743,6 +743,12 @@ TEST_F(WindowSelectorTest, CreateLabelUnderWindow) {
views::Label* label = static_cast<views::Label*>(widget->GetContentsView());
// Verify the label matches the window title.
EXPECT_EQ(label->text(), window_title);
+
+ // Update the window title and check that the label is updated, too.
+ base::string16 updated_title = base::UTF8ToUTF16("Updated title");
+ window->SetTitle(updated_title);
+ EXPECT_EQ(label->text(), updated_title);
+
// Labels are located based on target_bounds, not the actual window item
// bounds.
gfx::Rect target_bounds(window_item->target_bounds());
@@ -761,8 +767,8 @@ TEST_F(WindowSelectorTest, CreateLabelUnderPanel) {
scoped_ptr<aura::Window> panel2(CreatePanelWindow(gfx::Rect(0, 0, 100, 100)));
base::string16 panel1_title = base::UTF8ToUTF16("My panel");
base::string16 panel2_title = base::UTF8ToUTF16("Another panel");
- panel1->set_title(panel1_title);
- panel2->set_title(panel2_title);
+ panel1->SetTitle(panel1_title);
+ panel2->SetTitle(panel2_title);
flackr 2014/06/24 17:10:51 Maybe test update of panel1 title and after deleti
Nina 2014/06/24 18:36:28 Updated test to cover these cases plus changing th
wm::ActivateWindow(panel1.get());
ToggleOverview();
WindowSelectorItem* window_item = GetWindowItemsForRoot(0).back();
@@ -948,8 +954,8 @@ TEST_F(WindowSelectorTest, CloseButtonOnPanels) {
aura::Window* window2 = widget2->GetNativeWindow();
base::string16 panel1_title = base::UTF8ToUTF16("Panel 1");
base::string16 panel2_title = base::UTF8ToUTF16("Panel 2");
- window1->set_title(panel1_title);
- window2->set_title(panel2_title);
+ window1->SetTitle(panel1_title);
+ window2->SetTitle(panel2_title);
wm::ActivateWindow(window1);
ToggleOverview();

Powered by Google App Engine
This is Rietveld 408576698