| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/ui/panels/test_panel_active_state_observer.h" | 23 #include "chrome/browser/ui/panels/test_panel_active_state_observer.h" |
| 24 #include "chrome/browser/ui/panels/test_panel_mouse_watcher.h" | 24 #include "chrome/browser/ui/panels/test_panel_mouse_watcher.h" |
| 25 #include "chrome/common/chrome_paths.h" | 25 #include "chrome/common/chrome_paths.h" |
| 26 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
| 27 #include "chrome/test/base/interactive_test_utils.h" | 27 #include "chrome/test/base/interactive_test_utils.h" |
| 28 #include "chrome/test/base/ui_test_utils.h" | 28 #include "chrome/test/base/ui_test_utils.h" |
| 29 #include "content/public/browser/notification_service.h" | 29 #include "content/public/browser/notification_service.h" |
| 30 #include "content/public/common/url_constants.h" | 30 #include "content/public/common/url_constants.h" |
| 31 #include "content/public/test/web_contents_tester.h" | 31 #include "content/public/test/web_contents_tester.h" |
| 32 #include "extensions/browser/extension_prefs.h" | 32 #include "extensions/browser/extension_prefs.h" |
| 33 #include "extensions/browser/extension_system.h" |
| 33 #include "extensions/browser/install_flag.h" | 34 #include "extensions/browser/install_flag.h" |
| 34 #include "extensions/common/manifest_constants.h" | 35 #include "extensions/common/manifest_constants.h" |
| 35 #include "sync/api/string_ordinal.h" | 36 #include "sync/api/string_ordinal.h" |
| 36 | 37 |
| 37 #if defined(OS_LINUX) | 38 #if defined(OS_LINUX) |
| 38 #include "chrome/browser/ui/browser_window.h" | |
| 39 #include "ui/base/x/x11_util.h" | 39 #include "ui/base/x/x11_util.h" |
| 40 #endif | 40 #endif |
| 41 | 41 |
| 42 #if defined(OS_MACOSX) | 42 #if defined(OS_MACOSX) |
| 43 #include "base/mac/scoped_nsautorelease_pool.h" | 43 #include "base/mac/scoped_nsautorelease_pool.h" |
| 44 #include "chrome/browser/ui/cocoa/run_loop_testing.h" | 44 #include "chrome/browser/ui/cocoa/run_loop_testing.h" |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 using content::WebContentsTester; | 47 using content::WebContentsTester; |
| 48 using extensions::Extension; | 48 using extensions::Extension; |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 | 558 |
| 559 scoped_ptr<base::DictionaryValue> input_value(extra_value.DeepCopy()); | 559 scoped_ptr<base::DictionaryValue> input_value(extra_value.DeepCopy()); |
| 560 input_value->SetString(extensions::manifest_keys::kVersion, "1.0.0.0"); | 560 input_value->SetString(extensions::manifest_keys::kVersion, "1.0.0.0"); |
| 561 input_value->SetString(extensions::manifest_keys::kName, "Sample Extension"); | 561 input_value->SetString(extensions::manifest_keys::kName, "Sample Extension"); |
| 562 | 562 |
| 563 std::string error; | 563 std::string error; |
| 564 scoped_refptr<Extension> extension = Extension::Create( | 564 scoped_refptr<Extension> extension = Extension::Create( |
| 565 full_path, location, *input_value, Extension::NO_FLAGS, &error); | 565 full_path, location, *input_value, Extension::NO_FLAGS, &error); |
| 566 EXPECT_TRUE(extension.get()); | 566 EXPECT_TRUE(extension.get()); |
| 567 EXPECT_STREQ("", error.c_str()); | 567 EXPECT_STREQ("", error.c_str()); |
| 568 browser()->profile()->GetExtensionService()->OnExtensionInstalled( | 568 extensions::ExtensionSystem::Get( |
| 569 extension.get(), | 569 browser()->profile())->extension_service()->OnExtensionInstalled( |
| 570 syncer::StringOrdinal(), | 570 extension.get(), |
| 571 extensions::kInstallFlagInstallImmediately); | 571 syncer::StringOrdinal(), |
| 572 extensions::kInstallFlagInstallImmediately); |
| 572 return extension; | 573 return extension; |
| 573 } | 574 } |
| 574 | 575 |
| 575 void BasePanelBrowserTest::CloseWindowAndWait(Panel* panel) { | 576 void BasePanelBrowserTest::CloseWindowAndWait(Panel* panel) { |
| 576 // Closing a panel may involve several async tasks. Need to use | 577 // Closing a panel may involve several async tasks. Need to use |
| 577 // message pump and wait for the notification. | 578 // message pump and wait for the notification. |
| 578 PanelManager* manager = PanelManager::GetInstance(); | 579 PanelManager* manager = PanelManager::GetInstance(); |
| 579 int panel_count = manager->num_panels(); | 580 int panel_count = manager->num_panels(); |
| 580 content::WindowedNotificationObserver signal( | 581 content::WindowedNotificationObserver signal( |
| 581 chrome::NOTIFICATION_PANEL_CLOSED, | 582 chrome::NOTIFICATION_PANEL_CLOSED, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 612 } | 613 } |
| 613 | 614 |
| 614 std::string BasePanelBrowserTest::MakePanelName(int index) { | 615 std::string BasePanelBrowserTest::MakePanelName(int index) { |
| 615 std::string panel_name("Panel"); | 616 std::string panel_name("Panel"); |
| 616 return panel_name + base::IntToString(index); | 617 return panel_name + base::IntToString(index); |
| 617 } | 618 } |
| 618 | 619 |
| 619 bool BasePanelBrowserTest::WmSupportWindowActivation() { | 620 bool BasePanelBrowserTest::WmSupportWindowActivation() { |
| 620 return true; | 621 return true; |
| 621 } | 622 } |
| OLD | NEW |