| 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/stringprintf.h" | 5 #include "base/stringprintf.h" |
| 6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
| 7 #include "chrome/browser/background/background_contents_service.h" | 7 #include "chrome/browser/background/background_contents_service.h" |
| 8 #include "chrome/browser/background/background_contents_service_factory.h" | 8 #include "chrome/browser/background/background_contents_service_factory.h" |
| 9 #include "chrome/browser/background/background_mode_manager.h" | 9 #include "chrome/browser/background/background_mode_manager.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // change. | 70 // change. |
| 71 content::WindowedNotificationObserver watcher( | 71 content::WindowedNotificationObserver watcher( |
| 72 chrome::NOTIFICATION_BACKGROUND_MODE_CHANGED, | 72 chrome::NOTIFICATION_BACKGROUND_MODE_CHANGED, |
| 73 content::NotificationService::AllSources()); | 73 content::NotificationService::AllSources()); |
| 74 watcher.Wait(); | 74 watcher.Wait(); |
| 75 return manager->IsBackgroundModeActiveForTest() == expected_background_mode; | 75 return manager->IsBackgroundModeActiveForTest() == expected_background_mode; |
| 76 #endif | 76 #endif |
| 77 } | 77 } |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 ScopedTempDir app_dir_; | 80 base::ScopedTempDir app_dir_; |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 // Disable on Mac only. http://crbug.com/95139 | 83 // Disable on Mac only. http://crbug.com/95139 |
| 84 #if defined(OS_MACOSX) | 84 #if defined(OS_MACOSX) |
| 85 #define MAYBE_Basic DISABLED_Basic | 85 #define MAYBE_Basic DISABLED_Basic |
| 86 #else | 86 #else |
| 87 #define MAYBE_Basic Basic | 87 #define MAYBE_Basic Basic |
| 88 #endif | 88 #endif |
| 89 | 89 |
| 90 IN_PROC_BROWSER_TEST_F(AppBackgroundPageApiTest, MAYBE_Basic) { | 90 IN_PROC_BROWSER_TEST_F(AppBackgroundPageApiTest, MAYBE_Basic) { |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 BackgroundContentsServiceFactory::GetForProfile(browser()->profile())-> | 405 BackgroundContentsServiceFactory::GetForProfile(browser()->profile())-> |
| 406 GetAppBackgroundContents(ASCIIToUTF16(extension->id()))); | 406 GetAppBackgroundContents(ASCIIToUTF16(extension->id()))); |
| 407 // Now close the BackgroundContents. | 407 // Now close the BackgroundContents. |
| 408 ASSERT_TRUE(RunExtensionTest("app_background_page/basic_close")) << message_; | 408 ASSERT_TRUE(RunExtensionTest("app_background_page/basic_close")) << message_; |
| 409 // Background mode should no longer be active. | 409 // Background mode should no longer be active. |
| 410 ASSERT_TRUE(WaitForBackgroundMode(false)); | 410 ASSERT_TRUE(WaitForBackgroundMode(false)); |
| 411 ASSERT_FALSE( | 411 ASSERT_FALSE( |
| 412 BackgroundContentsServiceFactory::GetForProfile(browser()->profile())-> | 412 BackgroundContentsServiceFactory::GetForProfile(browser()->profile())-> |
| 413 GetAppBackgroundContents(ASCIIToUTF16(extension->id()))); | 413 GetAppBackgroundContents(ASCIIToUTF16(extension->id()))); |
| 414 } | 414 } |
| OLD | NEW |