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/ui/panels/base_panel_browser_test.h" | 5 #include "chrome/browser/ui/panels/base_panel_browser_test.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.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" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/run_loop.h" |
14 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
15 #include "build/build_config.h" | 16 #include "build/build_config.h" |
16 #include "chrome/browser/chrome_notification_types.h" | 17 #include "chrome/browser/chrome_notification_types.h" |
17 #include "chrome/browser/extensions/extension_service.h" | 18 #include "chrome/browser/extensions/extension_service.h" |
18 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
19 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
20 #include "chrome/browser/ui/browser_window.h" | 21 #include "chrome/browser/ui/browser_window.h" |
21 #include "chrome/browser/ui/panels/detached_panel_collection.h" | 22 #include "chrome/browser/ui/panels/detached_panel_collection.h" |
22 #include "chrome/browser/ui/panels/native_panel.h" | 23 #include "chrome/browser/ui/panels/native_panel.h" |
23 #include "chrome/browser/ui/panels/panel_collection.h" | 24 #include "chrome/browser/ui/panels/panel_collection.h" |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 EXPECT_TRUE(panel->auto_resizable()); | 356 EXPECT_TRUE(panel->auto_resizable()); |
356 } | 357 } |
357 | 358 |
358 if (params.show_flag == SHOW_AS_ACTIVE) { | 359 if (params.show_flag == SHOW_AS_ACTIVE) { |
359 panel->Show(); | 360 panel->Show(); |
360 } else { | 361 } else { |
361 panel->ShowInactive(); | 362 panel->ShowInactive(); |
362 } | 363 } |
363 | 364 |
364 if (params.wait_for_fully_created) { | 365 if (params.wait_for_fully_created) { |
365 base::MessageLoopForUI::current()->RunUntilIdle(); | 366 DCHECK(base::MessageLoopForUI::IsCurrent()); |
| 367 base::RunLoop().RunUntilIdle(); |
366 | 368 |
367 #if defined(OS_LINUX) && defined(USE_X11) | 369 #if defined(OS_LINUX) && defined(USE_X11) |
368 // On bots, we might have a simple window manager which always activates new | 370 // On bots, we might have a simple window manager which always activates new |
369 // windows, and can't always deactivate them. Re-activate the main tabbed | 371 // windows, and can't always deactivate them. Re-activate the main tabbed |
370 // browser to "deactivate" the newly created panel. | 372 // browser to "deactivate" the newly created panel. |
371 if (params.expected_active_state == SHOW_AS_INACTIVE && | 373 if (params.expected_active_state == SHOW_AS_INACTIVE && |
372 ui::GuessWindowManager() == ui::WM_ICE_WM) { | 374 ui::GuessWindowManager() == ui::WM_ICE_WM) { |
373 // Wait for new panel to become active before deactivating to ensure | 375 // Wait for new panel to become active before deactivating to ensure |
374 // the activated notification is consumed before we wait for the panel | 376 // the activated notification is consumed before we wait for the panel |
375 // to become inactive. | 377 // to become inactive. |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 } | 583 } |
582 | 584 |
583 std::string BasePanelBrowserTest::MakePanelName(int index) { | 585 std::string BasePanelBrowserTest::MakePanelName(int index) { |
584 std::string panel_name("Panel"); | 586 std::string panel_name("Panel"); |
585 return panel_name + base::IntToString(index); | 587 return panel_name + base::IntToString(index); |
586 } | 588 } |
587 | 589 |
588 bool BasePanelBrowserTest::WmSupportWindowActivation() { | 590 bool BasePanelBrowserTest::WmSupportWindowActivation() { |
589 return true; | 591 return true; |
590 } | 592 } |
OLD | NEW |