| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/bookmarks/bookmark_model.h" | 8 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 9 #include "chrome/browser/extensions/browser_action_test_util.h" | 9 #include "chrome/browser/extensions/browser_action_test_util.h" |
| 10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
| 11 #include "chrome/browser/extensions/extension_event_router.h" | 11 #include "chrome/browser/extensions/extension_event_router.h" |
| 12 #include "chrome/browser/extensions/extension_host.h" | 12 #include "chrome/browser/extensions/extension_host.h" |
| 13 #include "chrome/browser/extensions/extension_test_message_listener.h" | 13 #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 14 #include "chrome/browser/extensions/extension_service.h" | 14 #include "chrome/browser/extensions/extension_service.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
| 17 #include "chrome/browser/ui/browser_list.h" | 17 #include "chrome/browser/ui/browser_list.h" |
| 18 #include "chrome/browser/ui/browser_window.h" | 18 #include "chrome/browser/ui/browser_window.h" |
| 19 #include "chrome/browser/ui/omnibox/location_bar.h" | 19 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 20 #include "chrome/common/chrome_notification_types.h" | 20 #include "chrome/common/chrome_notification_types.h" |
| 21 #include "chrome/common/chrome_switches.h" | 21 #include "chrome/common/chrome_switches.h" |
| 22 #include "chrome/common/extensions/extension.h" | 22 #include "chrome/common/extensions/extension.h" |
| 23 #include "chrome/test/base/ui_test_utils.h" | 23 #include "chrome/test/base/ui_test_utils.h" |
| 24 #include "content/public/browser/notification_service.h" | 24 #include "content/public/browser/notification_service.h" |
| 25 #include "content/public/browser/web_contents.h" | 25 #include "content/public/browser/web_contents.h" |
| 26 #include "googleurl/src/gurl.h" | 26 #include "googleurl/src/gurl.h" |
| 27 #include "net/base/mock_host_resolver.h" | 27 #include "net/base/mock_host_resolver.h" |
| 28 | 28 |
| 29 using extensions::Extension; |
| 30 |
| 29 namespace { | 31 namespace { |
| 30 // Helper class to wait for a lazy background page to load and close again. | 32 // Helper class to wait for a lazy background page to load and close again. |
| 31 class LazyBackgroundObserver { | 33 class LazyBackgroundObserver { |
| 32 public: | 34 public: |
| 33 LazyBackgroundObserver() | 35 LazyBackgroundObserver() |
| 34 : page_created_(chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, | 36 : page_created_(chrome::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, |
| 35 content::NotificationService::AllSources()), | 37 content::NotificationService::AllSources()), |
| 36 page_closed_(chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, | 38 page_closed_(chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED, |
| 37 content::NotificationService::AllSources()) { | 39 content::NotificationService::AllSources()) { |
| 38 } | 40 } |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 | 384 |
| 383 // The browser action has a new title. | 385 // The browser action has a new title. |
| 384 BrowserActionTestUtil browser_action(browser()); | 386 BrowserActionTestUtil browser_action(browser()); |
| 385 ASSERT_EQ(1, browser_action.NumberOfBrowserActions()); | 387 ASSERT_EQ(1, browser_action.NumberOfBrowserActions()); |
| 386 EXPECT_EQ("Success", browser_action.GetTooltip(0)); | 388 EXPECT_EQ("Success", browser_action.GetTooltip(0)); |
| 387 } | 389 } |
| 388 | 390 |
| 389 // TODO: background page with timer. | 391 // TODO: background page with timer. |
| 390 // TODO: background page that interacts with popup. | 392 // TODO: background page that interacts with popup. |
| 391 // TODO: background page with menu. | 393 // TODO: background page with menu. |
| OLD | NEW |