| 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/macros.h" | 5 #include "base/macros.h" |
| 6 #include "base/run_loop.h" | 6 #include "base/run_loop.h" |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/browser/apps/app_browsertest_util.h" | 9 #include "chrome/browser/apps/app_browsertest_util.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 Profile* profile_; | 48 Profile* profile_; |
| 49 int icon_updates_; | 49 int icon_updates_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(TestAppWindowRegistryObserver); | 51 DISALLOW_COPY_AND_ASSIGN(TestAppWindowRegistryObserver); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 } // namespace | 54 } // namespace |
| 55 | 55 |
| 56 // Tests chrome.app.window.setIcon. | 56 // Tests chrome.app.window.setIcon. |
| 57 IN_PROC_BROWSER_TEST_F(ExperimentalPlatformAppBrowserTest, WindowsApiSetIcon) { | 57 IN_PROC_BROWSER_TEST_F(ExperimentalPlatformAppBrowserTest, WindowsApiSetIcon) { |
| 58 scoped_ptr<TestAppWindowRegistryObserver> test_observer( | 58 std::unique_ptr<TestAppWindowRegistryObserver> test_observer( |
| 59 new TestAppWindowRegistryObserver(browser()->profile())); | 59 new TestAppWindowRegistryObserver(browser()->profile())); |
| 60 ExtensionTestMessageListener listener("ready", true); | 60 ExtensionTestMessageListener listener("ready", true); |
| 61 | 61 |
| 62 // Launch the app and wait for it to be ready. | 62 // Launch the app and wait for it to be ready. |
| 63 LoadAndLaunchPlatformApp("windows_api_set_icon", &listener); | 63 LoadAndLaunchPlatformApp("windows_api_set_icon", &listener); |
| 64 EXPECT_EQ(0, test_observer->icon_updates()); | 64 EXPECT_EQ(0, test_observer->icon_updates()); |
| 65 listener.Reply(""); | 65 listener.Reply(""); |
| 66 | 66 |
| 67 // Now wait until the WebContent has decoded the icon and chrome has | 67 // Now wait until the WebContent has decoded the icon and chrome has |
| 68 // processed it. This needs to be in a loop since the renderer runs in a | 68 // processed it. This needs to be in a loop since the renderer runs in a |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 command_line->AppendSwitchASCII(switches::kAppId, | 210 command_line->AppendSwitchASCII(switches::kAppId, |
| 211 "jkghodnilhceideoidjikpgommlajknk"); | 211 "jkghodnilhceideoidjikpgommlajknk"); |
| 212 | 212 |
| 213 EXPECT_TRUE(RunComponentExtensionTest( | 213 EXPECT_TRUE(RunComponentExtensionTest( |
| 214 "platform_apps/windows_api_ime/forced_app_mode_not_fullscreen")) | 214 "platform_apps/windows_api_ime/forced_app_mode_not_fullscreen")) |
| 215 << message_; | 215 << message_; |
| 216 } | 216 } |
| 217 #endif // OS_CHROMEOS | 217 #endif // OS_CHROMEOS |
| 218 | 218 |
| 219 } // namespace extensions | 219 } // namespace extensions |
| OLD | NEW |