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

Side by Side Diff: chrome/browser/ui/panels/panel_browser_view_browsertest.cc

Issue 8183005: Choose the right window to switch to when a panel is deactivated on Windows. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/i18n/time_formatting.h" 5 #include "base/i18n/time_formatting.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "chrome/browser/extensions/extension_service.h" 7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/browser_window.h" 9 #include "chrome/browser/ui/browser_window.h"
10 #include "chrome/browser/ui/panels/base_panel_browser_test.h" 10 #include "chrome/browser/ui/panels/base_panel_browser_test.h"
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 EXPECT_GT(settings_button->height(), 0); 493 EXPECT_GT(settings_button->height(), 0);
494 EXPECT_LT(settings_button->height(), titlebar_height); 494 EXPECT_LT(settings_button->height(), titlebar_height);
495 EXPECT_GT(close_button->width(), 0); 495 EXPECT_GT(close_button->width(), 0);
496 EXPECT_GT(close_button->height(), 0); 496 EXPECT_GT(close_button->height(), 0);
497 EXPECT_LT(close_button->height(), titlebar_height); 497 EXPECT_LT(close_button->height(), titlebar_height);
498 EXPECT_LT(title_icon->x() + title_icon->width(), title_text->x()); 498 EXPECT_LT(title_icon->x() + title_icon->width(), title_text->x());
499 EXPECT_LT(title_text->x() + title_text->width(), settings_button->x()); 499 EXPECT_LT(title_text->x() + title_text->width(), settings_button->x());
500 EXPECT_LT(settings_button->x() + settings_button->width(), close_button->x()); 500 EXPECT_LT(settings_button->x() + settings_button->width(), close_button->x());
501 } 501 }
502 502
503 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, Deactivate) {
504 // When a panel is created, it should be active at first.
505 Panel* panel = CreatePanel("PanelTest");
506 EXPECT_TRUE(panel->IsActive());
507
508 // When the panel is deactivated, the appearance of controls should be
509 // updated.
510 views::Label* title_text = GetTitleText(panel);
511 SkColor title_text_color_before = title_text->GetColor();
512
513 panel->Deactivate();
514 EXPECT_FALSE(panel->IsActive());
515
516 SkColor title_text_color_after = title_text->GetColor();
517 EXPECT_NE(title_text_color_before, title_text_color_after);
518 }
519
520 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, ShowOrHideSettingsButton) { 503 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, ShowOrHideSettingsButton) {
521 Panel* panel = CreatePanel("PanelTest"); 504 Panel* panel = CreatePanel("PanelTest");
522 views::View* settings_button = GetSettingsButton(panel); 505 views::View* settings_button = GetSettingsButton(panel);
523 506
524 // Create and hook up the MockMouseWatcher so that we can simulate if the 507 // Create and hook up the MockMouseWatcher so that we can simulate if the
525 // mouse is over the panel. 508 // mouse is over the panel.
526 MockMouseWatcher* mouse_watcher = CreateTitlebarMouseWatcher(panel); 509 MockMouseWatcher* mouse_watcher = CreateTitlebarMouseWatcher(panel);
527 510
528 // When the panel is created, it is active. Since we cannot programatically 511 // When the panel is created, it is active. Since we cannot programatically
529 // bring the panel back to active state once it is deactivated, we have to 512 // bring the panel back to active state once it is deactivated, we have to
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 578
596 // TODO(jianli): Investigate why this fails on win trunk build. 579 // TODO(jianli): Investigate why this fails on win trunk build.
597 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, DISABLED_DrawAttention) { 580 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, DISABLED_DrawAttention) {
598 TestDrawAttention(); 581 TestDrawAttention();
599 } 582 }
600 583
601 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, ChangeAutoHideTaskBarThickness) { 584 IN_PROC_BROWSER_TEST_F(PanelBrowserViewTest, ChangeAutoHideTaskBarThickness) {
602 TestChangeAutoHideTaskBarThickness(); 585 TestChangeAutoHideTaskBarThickness();
603 } 586 }
604 #endif 587 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698