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

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

Issue 9195003: Move IN_OVERFLOW from Panel::ExpansionState to new enum. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedback Created 8 years, 11 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
« no previous file with comments | « chrome/browser/ui/panels/base_panel_browser_test.h ('k') | chrome/browser/ui/panels/panel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ui/panels/base_panel_browser_test.h" 5 #include "chrome/browser/ui/panels/base_panel_browser_test.h"
6 6
7 #include "chrome/browser/ui/browser_list.h" 7 #include "chrome/browser/ui/browser_list.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 NativePanelTesting::Create(panel->native_panel())); 254 NativePanelTesting::Create(panel->native_panel()));
255 ui_test_utils::WindowedNotificationObserver signal( 255 ui_test_utils::WindowedNotificationObserver signal(
256 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, 256 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED,
257 content::Source<Panel>(panel)); 257 content::Source<Panel>(panel));
258 if (!panel_testing->IsAnimatingBounds()) 258 if (!panel_testing->IsAnimatingBounds())
259 return; 259 return;
260 signal.Wait(); 260 signal.Wait();
261 EXPECT_TRUE(!panel_testing->IsAnimatingBounds()); 261 EXPECT_TRUE(!panel_testing->IsAnimatingBounds());
262 } 262 }
263 263
264 void BasePanelBrowserTest::WaitForLayoutStateChanged(
265 Panel* panel, Panel::LayoutState layout_state) {
266 ui_test_utils::WindowedNotificationObserver signal(
267 chrome::NOTIFICATION_PANEL_CHANGED_LAYOUT_STATE,
268 content::Source<Panel>(panel));
269 if (panel->layout_state() == layout_state)
270 return;
271 signal.Wait();
272 EXPECT_EQ(layout_state, panel->layout_state());
273 }
274
264 void BasePanelBrowserTest::WaitForExpansionStateChanged( 275 void BasePanelBrowserTest::WaitForExpansionStateChanged(
265 Panel* panel, Panel::ExpansionState expansion_state) { 276 Panel* panel, Panel::ExpansionState expansion_state) {
266 ui_test_utils::WindowedNotificationObserver signal( 277 ui_test_utils::WindowedNotificationObserver signal(
267 chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, 278 chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE,
268 content::Source<Panel>(panel)); 279 content::Source<Panel>(panel));
269 if (panel->expansion_state() == expansion_state) 280 if (panel->expansion_state() == expansion_state)
270 return; 281 return;
271 signal.Wait(); 282 signal.Wait();
272 EXPECT_EQ(expansion_state, panel->expansion_state()); 283 EXPECT_EQ(expansion_state, panel->expansion_state());
273 } 284 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 scoped_refptr<Extension> extension = Extension::Create( 394 scoped_refptr<Extension> extension = Extension::Create(
384 full_path, location, *input_value, 395 full_path, location, *input_value,
385 Extension::STRICT_ERROR_CHECKS, &error); 396 Extension::STRICT_ERROR_CHECKS, &error);
386 EXPECT_TRUE(extension.get()); 397 EXPECT_TRUE(extension.get());
387 EXPECT_STREQ("", error.c_str()); 398 EXPECT_STREQ("", error.c_str());
388 browser()->GetProfile()->GetExtensionService()-> 399 browser()->GetProfile()->GetExtensionService()->
389 OnExtensionInstalled(extension.get(), false, StringOrdinal()); 400 OnExtensionInstalled(extension.get(), false, StringOrdinal());
390 return extension; 401 return extension;
391 } 402 }
392 403
404 void BasePanelBrowserTest::ClickPanelTitlebar(Panel* panel) {
405 scoped_ptr<NativePanelTesting> native_panel_testing(
406 NativePanelTesting::Create(panel->native_panel()));
407 native_panel_testing->PressLeftMouseButtonTitlebar(
408 panel->GetBounds().origin());
409 native_panel_testing->ReleaseMouseButtonTitlebar();
410 }
411
393 void BasePanelBrowserTest::CloseWindowAndWait(Browser* browser) { 412 void BasePanelBrowserTest::CloseWindowAndWait(Browser* browser) {
394 // Closing a browser window may involve several async tasks. Need to use 413 // Closing a browser window may involve several async tasks. Need to use
395 // message pump and wait for the notification. 414 // message pump and wait for the notification.
396 size_t browser_count = BrowserList::size(); 415 size_t browser_count = BrowserList::size();
397 ui_test_utils::WindowedNotificationObserver signal( 416 ui_test_utils::WindowedNotificationObserver signal(
398 chrome::NOTIFICATION_BROWSER_CLOSED, 417 chrome::NOTIFICATION_BROWSER_CLOSED,
399 content::Source<Browser>(browser)); 418 content::Source<Browser>(browser));
400 browser->CloseWindow(); 419 browser->CloseWindow();
401 signal.Wait(); 420 signal.Wait();
402 // Now we have one less browser instance. 421 // Now we have one less browser instance.
403 EXPECT_EQ(browser_count - 1, BrowserList::size()); 422 EXPECT_EQ(browser_count - 1, BrowserList::size());
404 } 423 }
405 424
406 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { 425 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) {
407 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); 426 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position);
408 } 427 }
409 428
410 std::string BasePanelBrowserTest::MakePanelName(int index) { 429 std::string BasePanelBrowserTest::MakePanelName(int index) {
411 std::string panel_name("Panel"); 430 std::string panel_name("Panel");
412 return panel_name + base::IntToString(index); 431 return panel_name + base::IntToString(index);
413 } 432 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/base_panel_browser_test.h ('k') | chrome/browser/ui/panels/panel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698