Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Side by Side Diff: chrome/browser/extensions/api/app_window/app_window_apitest.cc

Issue 411253002: Fix flaky WindowsApiSetIcon test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/test/data/extensions/platform_apps/windows_api_set_icon/background.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "apps/app_window.h" 5 #include "apps/app_window.h"
6 #include "apps/app_window_registry.h" 6 #include "apps/app_window_registry.h"
7 #include "apps/ui/native_app_window.h" 7 #include "apps/ui/native_app_window.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "chrome/browser/apps/app_browsertest_util.h" 10 #include "chrome/browser/apps/app_browsertest_util.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 }; 44 };
45 45
46 } // namespace 46 } // namespace
47 47
48 namespace extensions { 48 namespace extensions {
49 49
50 // Tests chrome.app.window.setIcon. 50 // Tests chrome.app.window.setIcon.
51 IN_PROC_BROWSER_TEST_F(ExperimentalPlatformAppBrowserTest, WindowsApiSetIcon) { 51 IN_PROC_BROWSER_TEST_F(ExperimentalPlatformAppBrowserTest, WindowsApiSetIcon) {
52 scoped_ptr<TestAppWindowRegistryObserver> test_observer( 52 scoped_ptr<TestAppWindowRegistryObserver> test_observer(
53 new TestAppWindowRegistryObserver(browser()->profile())); 53 new TestAppWindowRegistryObserver(browser()->profile()));
54 LoadAndLaunchPlatformApp("windows_api_set_icon", "IconSet"); 54 ExtensionTestMessageListener listener("ready", true);
55
56 // Launch the app and wait for it to be ready.
57 LoadAndLaunchPlatformApp("windows_api_set_icon", &listener);
55 EXPECT_EQ(0, test_observer->icon_updates()); 58 EXPECT_EQ(0, test_observer->icon_updates());
59 listener.Reply("");
60
56 // Now wait until the WebContent has decoded the icon and chrome has 61 // Now wait until the WebContent has decoded the icon and chrome has
57 // processed it. This needs to be in a loop since the renderer runs in a 62 // processed it. This needs to be in a loop since the renderer runs in a
58 // different process. 63 // different process.
59 while (test_observer->icon_updates() < 1) { 64 while (test_observer->icon_updates() < 1) {
60 base::RunLoop run_loop; 65 base::RunLoop run_loop;
61 run_loop.RunUntilIdle(); 66 run_loop.RunUntilIdle();
62 } 67 }
63 AppWindow* app_window = GetFirstAppWindow(); 68 AppWindow* app_window = GetFirstAppWindow();
64 ASSERT_TRUE(app_window); 69 ASSERT_TRUE(app_window);
65 EXPECT_NE(std::string::npos, 70 EXPECT_NE(std::string::npos,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 EXPECT_TRUE(RunPlatformAppTest( 104 EXPECT_TRUE(RunPlatformAppTest(
100 "platform_apps/windows_api_always_on_top/no_permissions")) << message_; 105 "platform_apps/windows_api_always_on_top/no_permissions")) << message_;
101 } 106 }
102 107
103 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, WindowsApiGet) { 108 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, WindowsApiGet) {
104 EXPECT_TRUE(RunPlatformAppTest("platform_apps/windows_api_get")) 109 EXPECT_TRUE(RunPlatformAppTest("platform_apps/windows_api_get"))
105 << message_; 110 << message_;
106 } 111 }
107 112
108 } // namespace extensions 113 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/extensions/platform_apps/windows_api_set_icon/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698