| 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.h" | 10 #include "base/message_loop.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
| 13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 16 #include "chrome/browser/ui/browser_tabstrip.h" | 16 #include "chrome/browser/ui/browser_tabstrip.h" |
| 17 #include "chrome/browser/ui/panels/native_panel.h" | 17 #include "chrome/browser/ui/panels/native_panel.h" |
| 18 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" | 18 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" |
| 19 #include "chrome/browser/ui/panels/panel_strip.h" | 19 #include "chrome/browser/ui/panels/panel_strip.h" |
| 20 #include "chrome/browser/ui/panels/test_panel_active_state_observer.h" | 20 #include "chrome/browser/ui/panels/test_panel_active_state_observer.h" |
| 21 #include "chrome/browser/ui/panels/test_panel_mouse_watcher.h" | 21 #include "chrome/browser/ui/panels/test_panel_mouse_watcher.h" |
| 22 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 22 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 23 #include "chrome/common/chrome_notification_types.h" | 23 #include "chrome/common/chrome_notification_types.h" |
| 24 #include "chrome/common/chrome_paths.h" | 24 #include "chrome/common/chrome_paths.h" |
| 25 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
| 26 #include "chrome/common/extensions/extension_manifest_constants.h" | 26 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 27 #include "chrome/common/string_ordinal.h" | |
| 28 #include "chrome/test/base/ui_test_utils.h" | 27 #include "chrome/test/base/ui_test_utils.h" |
| 29 #include "content/public/browser/notification_service.h" | 28 #include "content/public/browser/notification_service.h" |
| 30 #include "content/public/common/url_constants.h" | 29 #include "content/public/common/url_constants.h" |
| 31 #include "content/public/test/web_contents_tester.h" | 30 #include "content/public/test/web_contents_tester.h" |
| 31 #include "sync/api/string_ordinal.h" |
| 32 | 32 |
| 33 #if defined(OS_LINUX) | 33 #if defined(OS_LINUX) |
| 34 #include "chrome/browser/ui/browser_window.h" | 34 #include "chrome/browser/ui/browser_window.h" |
| 35 #include "ui/base/x/x11_util.h" | 35 #include "ui/base/x/x11_util.h" |
| 36 #endif | 36 #endif |
| 37 | 37 |
| 38 #if defined(OS_MACOSX) | 38 #if defined(OS_MACOSX) |
| 39 #include "base/mac/scoped_nsautorelease_pool.h" | 39 #include "base/mac/scoped_nsautorelease_pool.h" |
| 40 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" | 40 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" |
| 41 #include "chrome/browser/ui/cocoa/run_loop_testing.h" | 41 #include "chrome/browser/ui/cocoa/run_loop_testing.h" |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 scoped_ptr<DictionaryValue> input_value(extra_value.DeepCopy()); | 423 scoped_ptr<DictionaryValue> input_value(extra_value.DeepCopy()); |
| 424 input_value->SetString(extension_manifest_keys::kVersion, "1.0.0.0"); | 424 input_value->SetString(extension_manifest_keys::kVersion, "1.0.0.0"); |
| 425 input_value->SetString(extension_manifest_keys::kName, "Sample Extension"); | 425 input_value->SetString(extension_manifest_keys::kName, "Sample Extension"); |
| 426 | 426 |
| 427 std::string error; | 427 std::string error; |
| 428 scoped_refptr<Extension> extension = Extension::Create( | 428 scoped_refptr<Extension> extension = Extension::Create( |
| 429 full_path, location, *input_value, Extension::NO_FLAGS, &error); | 429 full_path, location, *input_value, Extension::NO_FLAGS, &error); |
| 430 EXPECT_TRUE(extension.get()); | 430 EXPECT_TRUE(extension.get()); |
| 431 EXPECT_STREQ("", error.c_str()); | 431 EXPECT_STREQ("", error.c_str()); |
| 432 browser()->profile()->GetExtensionService()-> | 432 browser()->profile()->GetExtensionService()-> |
| 433 OnExtensionInstalled(extension.get(), false, StringOrdinal()); | 433 OnExtensionInstalled(extension.get(), false, syncer::StringOrdinal()); |
| 434 return extension; | 434 return extension; |
| 435 } | 435 } |
| 436 | 436 |
| 437 void BasePanelBrowserTest::SetTestingAreas(const gfx::Rect& primary_screen_area, | 437 void BasePanelBrowserTest::SetTestingAreas(const gfx::Rect& primary_screen_area, |
| 438 const gfx::Rect& work_area) { | 438 const gfx::Rect& work_area) { |
| 439 DCHECK(primary_screen_area.Contains(work_area)); | 439 DCHECK(primary_screen_area.Contains(work_area)); |
| 440 mock_display_settings_provider_->SetPrimaryScreenArea(primary_screen_area); | 440 mock_display_settings_provider_->SetPrimaryScreenArea(primary_screen_area); |
| 441 mock_display_settings_provider_->SetWorkArea( | 441 mock_display_settings_provider_->SetWorkArea( |
| 442 work_area.IsEmpty() ? primary_screen_area : work_area); | 442 work_area.IsEmpty() ? primary_screen_area : work_area); |
| 443 } | 443 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 } | 478 } |
| 479 | 479 |
| 480 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { | 480 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { |
| 481 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); | 481 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); |
| 482 } | 482 } |
| 483 | 483 |
| 484 std::string BasePanelBrowserTest::MakePanelName(int index) { | 484 std::string BasePanelBrowserTest::MakePanelName(int index) { |
| 485 std::string panel_name("Panel"); | 485 std::string panel_name("Panel"); |
| 486 return panel_name + base::IntToString(index); | 486 return panel_name + base::IntToString(index); |
| 487 } | 487 } |
| OLD | NEW |