[email protected] | a4465720 | 2012-01-09 05:48:31 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | cfc6cca | 2011-12-01 02:30:06 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
[email protected] | a6db612 | 2012-09-03 06:00:23 | [diff] [blame] | 5 | #include "base/bind.h" |
[email protected] | 939532d0 | 2012-08-31 23:37:33 | [diff] [blame] | 6 | #include "base/test/test_timeouts.h" |
| 7 | #include "base/threading/platform_thread.h" |
[email protected] | b3c019b | 2012-08-28 02:43:48 | [diff] [blame] | 8 | #include "base/utf_string_conversions.h" |
[email protected] | ad687a7 | 2012-06-08 06:03:11 | [diff] [blame] | 9 | #include "chrome/app/chrome_command_ids.h" |
[email protected] | 605fb810 | 2012-05-04 01:36:55 | [diff] [blame] | 10 | #include "chrome/browser/automation/automation_util.h" |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 11 | #include "chrome/browser/tab_contents/render_view_context_menu.h" |
[email protected] | a6db612 | 2012-09-03 06:00:23 | [diff] [blame] | 12 | #include "chrome/browser/extensions/extension_browsertest.h" |
[email protected] | 25977110 | 2012-05-31 16:52:20 | [diff] [blame] | 13 | #include "chrome/browser/extensions/extension_test_message_listener.h" |
| 14 | #include "chrome/browser/extensions/platform_app_browsertest_util.h" |
[email protected] | a6db612 | 2012-09-03 06:00:23 | [diff] [blame] | 15 | #include "chrome/browser/extensions/platform_app_launcher.h" |
[email protected] | 25977110 | 2012-05-31 16:52:20 | [diff] [blame] | 16 | #include "chrome/browser/extensions/shell_window_registry.h" |
[email protected] | cfc6cca | 2011-12-01 02:30:06 | [diff] [blame] | 17 | #include "chrome/browser/ui/browser.h" |
[email protected] | 52877dbc6 | 2012-06-29 22:22:03 | [diff] [blame] | 18 | #include "chrome/browser/ui/browser_tabstrip.h" |
[email protected] | a5a0be0 | 2012-07-18 05:51:54 | [diff] [blame] | 19 | #include "chrome/browser/ui/extensions/application_launch.h" |
[email protected] | d72d3a6 | 2012-05-10 03:45:08 | [diff] [blame] | 20 | #include "chrome/browser/ui/extensions/shell_window.h" |
[email protected] | 5b1a04b4 | 2012-06-15 00:41:44 | [diff] [blame] | 21 | #include "chrome/common/chrome_notification_types.h" |
[email protected] | cfc6cca | 2011-12-01 02:30:06 | [diff] [blame] | 22 | #include "chrome/test/base/ui_test_utils.h" |
[email protected] | fb29e6cf | 2012-07-12 21:27:20 | [diff] [blame] | 23 | #include "content/public/browser/render_process_host.h" |
[email protected] | a6db612 | 2012-09-03 06:00:23 | [diff] [blame] | 24 | #include "content/public/browser/web_intents_dispatcher.h" |
| 25 | #include "googleurl/src/gurl.h" |
| 26 | #include "webkit/glue/web_intent_data.h" |
[email protected] | cfc6cca | 2011-12-01 02:30:06 | [diff] [blame] | 27 | |
[email protected] | bb81f38 | 2012-01-03 22:45:44 | [diff] [blame] | 28 | using content::WebContents; |
[email protected] | d9ede58 | 2012-08-14 19:21:38 | [diff] [blame] | 29 | |
| 30 | namespace extensions { |
[email protected] | 31bdbfef | 2012-05-22 19:59:15 | [diff] [blame] | 31 | |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 32 | namespace { |
[email protected] | 85d3d5e | 2012-08-31 21:19:17 | [diff] [blame] | 33 | |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 34 | // Non-abstract RenderViewContextMenu class. |
| 35 | class PlatformAppContextMenu : public RenderViewContextMenu { |
| 36 | public: |
[email protected] | bb81f38 | 2012-01-03 22:45:44 | [diff] [blame] | 37 | PlatformAppContextMenu(WebContents* web_contents, |
[email protected] | 35be7ec | 2012-02-12 20:42:51 | [diff] [blame] | 38 | const content::ContextMenuParams& params) |
[email protected] | bb81f38 | 2012-01-03 22:45:44 | [diff] [blame] | 39 | : RenderViewContextMenu(web_contents, params) {} |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 40 | |
[email protected] | ad687a7 | 2012-06-08 06:03:11 | [diff] [blame] | 41 | bool HasCommandWithId(int command_id) { |
| 42 | return menu_model_.GetIndexOfCommandId(command_id) != -1; |
| 43 | } |
| 44 | |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 45 | protected: |
[email protected] | 85d3d5e | 2012-08-31 21:19:17 | [diff] [blame] | 46 | // RenderViewContextMenu implementation. |
| 47 | virtual bool GetAcceleratorForCommandId( |
| 48 | int command_id, |
| 49 | ui::Accelerator* accelerator) OVERRIDE { |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 50 | return false; |
| 51 | } |
[email protected] | 85d3d5e | 2012-08-31 21:19:17 | [diff] [blame] | 52 | virtual void PlatformInit() OVERRIDE {} |
| 53 | virtual void PlatformCancel() OVERRIDE {} |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 54 | }; |
| 55 | |
[email protected] | a6db612 | 2012-09-03 06:00:23 | [diff] [blame] | 56 | // State holder for the LaunchReply test. This provides an WebIntentsDispatcher |
| 57 | // that will, when used to launch a Web Intent, will return its reply via this |
| 58 | // class. The result may then be waited on via WaitUntilReply(). |
| 59 | class LaunchReplyHandler { |
| 60 | public: |
| 61 | explicit LaunchReplyHandler(webkit_glue::WebIntentData& data) |
| 62 | : data_(data), |
| 63 | replied_(false), |
| 64 | weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
| 65 | intents_dispatcher_ = content::WebIntentsDispatcher::Create(data); |
| 66 | intents_dispatcher_->RegisterReplyNotification(base::Bind( |
| 67 | &LaunchReplyHandler::OnReply, weak_ptr_factory_.GetWeakPtr())); |
| 68 | } |
| 69 | |
| 70 | content::WebIntentsDispatcher* intents_dispatcher() { |
| 71 | return intents_dispatcher_; |
| 72 | } |
| 73 | |
| 74 | // Waits until a reply to this Web Intent is provided via the |
| 75 | // WebIntentsDispatcher. |
| 76 | bool WaitUntilReply() { |
| 77 | if (replied_) |
| 78 | return true; |
| 79 | waiting_ = true; |
| 80 | content::RunMessageLoop(); |
| 81 | waiting_ = false; |
| 82 | return replied_; |
| 83 | } |
| 84 | |
| 85 | private: |
| 86 | void OnReply(webkit_glue::WebIntentReplyType reply) { |
| 87 | // Note that the ReplyNotification registered on WebIntentsDispatcher does |
| 88 | // not include the result data: this is reserved for the source page (which |
| 89 | // we don't care about). |
| 90 | replied_ = true; |
| 91 | if (waiting_) |
| 92 | MessageLoopForUI::current()->Quit(); |
| 93 | } |
| 94 | |
| 95 | webkit_glue::WebIntentData data_; |
| 96 | bool replied_; |
| 97 | bool waiting_; |
| 98 | content::WebIntentsDispatcher* intents_dispatcher_; |
| 99 | base::WeakPtrFactory<LaunchReplyHandler> weak_ptr_factory_; |
| 100 | }; |
| 101 | |
[email protected] | 85d3d5e | 2012-08-31 21:19:17 | [diff] [blame] | 102 | const char kTestFilePath[] = "platform_apps/launch_files/test.txt"; |
| 103 | |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 104 | } // namespace |
| 105 | |
[email protected] | eb4bcac | 2012-06-27 01:32:08 | [diff] [blame] | 106 | // Tests that CreateShellWindow doesn't crash if you close it straight away. |
| 107 | // LauncherPlatformAppBrowserTest relies on this behaviour, but is only run for |
| 108 | // ash, so we test that it works here. |
| 109 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, CreateAndCloseShellWindow) { |
| 110 | const Extension* extension = LoadAndLaunchPlatformApp("minimal"); |
| 111 | ShellWindow* window = CreateShellWindow(extension); |
| 112 | CloseShellWindow(window); |
| 113 | } |
| 114 | |
[email protected] | dc37b00 | 2012-04-23 23:02:26 | [diff] [blame] | 115 | // Tests that platform apps received the "launch" event when launched. |
| 116 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, OnLaunchedEvent) { |
| 117 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch")) << message_; |
[email protected] | cfc6cca | 2011-12-01 02:30:06 | [diff] [blame] | 118 | } |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 119 | |
[email protected] | a6db612 | 2012-09-03 06:00:23 | [diff] [blame] | 120 | // Tests that platform apps can reply to "launch" events that contain a Web |
| 121 | // Intent. This test does not test the mechanics of invoking a Web Intent |
| 122 | // from a source page, and short-circuits to LaunchPlatformAppWithWebIntent. |
| 123 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchReply) { |
| 124 | FilePath path = test_data_dir_.AppendASCII("platform_apps/launch_reply"); |
| 125 | const extensions::Extension* extension = LoadExtension(path); |
| 126 | ASSERT_TRUE(extension) << "Failed to load extension."; |
| 127 | |
| 128 | webkit_glue::WebIntentData data( |
| 129 | UTF8ToUTF16("http://webintents.org/view"), |
| 130 | UTF8ToUTF16("text/plain"), |
| 131 | UTF8ToUTF16("irrelevant unserialized string data")); |
| 132 | LaunchReplyHandler handler(data); |
| 133 | |
| 134 | // Navigate to a boring page: we don't care what it is, but we require some |
| 135 | // source WebContents to launch the Web Intent "from". |
| 136 | ui_test_utils::NavigateToURL(browser(), GURL("about:blank")); |
| 137 | WebContents* web_contents = chrome::GetActiveWebContents(browser()); |
| 138 | ASSERT_TRUE(web_contents); |
| 139 | |
| 140 | extensions::LaunchPlatformAppWithWebIntent( |
| 141 | browser()->profile(), |
| 142 | extension, |
| 143 | handler.intents_dispatcher(), |
| 144 | web_contents); |
| 145 | |
| 146 | ASSERT_TRUE(handler.WaitUntilReply()); |
| 147 | } |
| 148 | |
[email protected] | 567230b | 2012-08-21 21:11:44 | [diff] [blame] | 149 | // Tests that platform apps cannot use certain disabled window properties, but |
| 150 | // can override them and then use them. |
| 151 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, DisabledWindowProperties) { |
| 152 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/disabled_window_properties")) |
| 153 | << message_; |
| 154 | } |
| 155 | |
[email protected] | edd7ed69 | 2012-02-08 02:50:03 | [diff] [blame] | 156 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, EmptyContextMenu) { |
[email protected] | dc37b00 | 2012-04-23 23:02:26 | [diff] [blame] | 157 | ExtensionTestMessageListener launched_listener("Launched", false); |
[email protected] | 31bdbfef | 2012-05-22 19:59:15 | [diff] [blame] | 158 | LoadAndLaunchPlatformApp("minimal"); |
[email protected] | dc37b00 | 2012-04-23 23:02:26 | [diff] [blame] | 159 | |
| 160 | ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 161 | |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 162 | // The empty app doesn't add any context menu items, so its menu should |
[email protected] | 0cfacd8 | 2012-02-09 01:55:33 | [diff] [blame] | 163 | // only include the developer tools. |
[email protected] | d72d3a6 | 2012-05-10 03:45:08 | [diff] [blame] | 164 | WebContents* web_contents = GetFirstShellWindowWebContents(); |
[email protected] | a4465720 | 2012-01-09 05:48:31 | [diff] [blame] | 165 | ASSERT_TRUE(web_contents); |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 166 | WebKit::WebContextMenuData data; |
[email protected] | 35be7ec | 2012-02-12 20:42:51 | [diff] [blame] | 167 | content::ContextMenuParams params(data); |
[email protected] | 85d3d5e | 2012-08-31 21:19:17 | [diff] [blame] | 168 | scoped_ptr<PlatformAppContextMenu> menu; |
| 169 | menu.reset(new PlatformAppContextMenu(web_contents, params)); |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 170 | menu->Init(); |
[email protected] | ad687a7 | 2012-06-08 06:03:11 | [diff] [blame] | 171 | ASSERT_TRUE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_INSPECTELEMENT)); |
[email protected] | 65992d5 | 2012-09-19 23:05:31 | [diff] [blame^] | 172 | ASSERT_TRUE( |
| 173 | menu->HasCommandWithId(IDC_CONTENT_CONTEXT_INSPECTBACKGROUNDPAGE)); |
[email protected] | ad687a7 | 2012-06-08 06:03:11 | [diff] [blame] | 174 | ASSERT_TRUE(menu->HasCommandWithId(IDC_RELOAD)); |
| 175 | ASSERT_FALSE(menu->HasCommandWithId(IDC_BACK)); |
| 176 | ASSERT_FALSE(menu->HasCommandWithId(IDC_SAVE_PAGE)); |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 177 | } |
| 178 | |
[email protected] | edd7ed69 | 2012-02-08 02:50:03 | [diff] [blame] | 179 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, AppWithContextMenu) { |
[email protected] | dc37b00 | 2012-04-23 23:02:26 | [diff] [blame] | 180 | ExtensionTestMessageListener launched_listener("Launched", false); |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 181 | LoadAndLaunchPlatformApp("context_menu"); |
| 182 | |
[email protected] | dc37b00 | 2012-04-23 23:02:26 | [diff] [blame] | 183 | // Wait for the extension to tell us it's initialized its context menus and |
| 184 | // launched a window. |
| 185 | ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 186 | |
[email protected] | 271d01c | 2012-08-27 23:48:05 | [diff] [blame] | 187 | // The context_menu app has two context menu items. These, along with a |
[email protected] | 0cfacd8 | 2012-02-09 01:55:33 | [diff] [blame] | 188 | // separator and the developer tools, is all that should be in the menu. |
[email protected] | d72d3a6 | 2012-05-10 03:45:08 | [diff] [blame] | 189 | WebContents* web_contents = GetFirstShellWindowWebContents(); |
[email protected] | a4465720 | 2012-01-09 05:48:31 | [diff] [blame] | 190 | ASSERT_TRUE(web_contents); |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 191 | WebKit::WebContextMenuData data; |
[email protected] | 35be7ec | 2012-02-12 20:42:51 | [diff] [blame] | 192 | content::ContextMenuParams params(data); |
[email protected] | 85d3d5e | 2012-08-31 21:19:17 | [diff] [blame] | 193 | scoped_ptr<PlatformAppContextMenu> menu; |
| 194 | menu.reset(new PlatformAppContextMenu(web_contents, params)); |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 195 | menu->Init(); |
[email protected] | ad687a7 | 2012-06-08 06:03:11 | [diff] [blame] | 196 | ASSERT_TRUE(menu->HasCommandWithId(IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST)); |
[email protected] | 271d01c | 2012-08-27 23:48:05 | [diff] [blame] | 197 | ASSERT_TRUE(menu->HasCommandWithId(IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST + 1)); |
[email protected] | ad687a7 | 2012-06-08 06:03:11 | [diff] [blame] | 198 | ASSERT_TRUE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_INSPECTELEMENT)); |
[email protected] | 65992d5 | 2012-09-19 23:05:31 | [diff] [blame^] | 199 | ASSERT_TRUE( |
| 200 | menu->HasCommandWithId(IDC_CONTENT_CONTEXT_INSPECTBACKGROUNDPAGE)); |
[email protected] | ad687a7 | 2012-06-08 06:03:11 | [diff] [blame] | 201 | ASSERT_TRUE(menu->HasCommandWithId(IDC_RELOAD)); |
| 202 | ASSERT_FALSE(menu->HasCommandWithId(IDC_BACK)); |
| 203 | ASSERT_FALSE(menu->HasCommandWithId(IDC_SAVE_PAGE)); |
[email protected] | b3c019b | 2012-08-28 02:43:48 | [diff] [blame] | 204 | ASSERT_FALSE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_UNDO)); |
| 205 | } |
| 206 | |
[email protected] | 65992d5 | 2012-09-19 23:05:31 | [diff] [blame^] | 207 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, InstalledAppWithContextMenu) { |
| 208 | ExtensionTestMessageListener launched_listener("Launched", false); |
| 209 | InstallAndLaunchPlatformApp("context_menu"); |
| 210 | |
| 211 | // Wait for the extension to tell us it's initialized its context menus and |
| 212 | // launched a window. |
| 213 | ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
| 214 | |
| 215 | // The context_menu app has two context menu items. For an installed app |
| 216 | // these are all that should be in the menu. |
| 217 | WebContents* web_contents = GetFirstShellWindowWebContents(); |
| 218 | ASSERT_TRUE(web_contents); |
| 219 | WebKit::WebContextMenuData data; |
| 220 | content::ContextMenuParams params(data); |
| 221 | scoped_ptr<PlatformAppContextMenu> menu; |
| 222 | menu.reset(new PlatformAppContextMenu(web_contents, params)); |
| 223 | menu->Init(); |
| 224 | ASSERT_TRUE(menu->HasCommandWithId(IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST)); |
| 225 | ASSERT_TRUE(menu->HasCommandWithId(IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST + 1)); |
| 226 | ASSERT_FALSE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_INSPECTELEMENT)); |
| 227 | ASSERT_FALSE( |
| 228 | menu->HasCommandWithId(IDC_CONTENT_CONTEXT_INSPECTBACKGROUNDPAGE)); |
| 229 | ASSERT_FALSE(menu->HasCommandWithId(IDC_RELOAD)); |
| 230 | ASSERT_FALSE(menu->HasCommandWithId(IDC_BACK)); |
| 231 | ASSERT_FALSE(menu->HasCommandWithId(IDC_SAVE_PAGE)); |
| 232 | ASSERT_FALSE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_UNDO)); |
| 233 | } |
| 234 | |
[email protected] | b3c019b | 2012-08-28 02:43:48 | [diff] [blame] | 235 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, AppWithContextMenuTextField) { |
| 236 | ExtensionTestMessageListener launched_listener("Launched", false); |
| 237 | LoadAndLaunchPlatformApp("context_menu"); |
| 238 | |
| 239 | // Wait for the extension to tell us it's initialized its context menus and |
| 240 | // launched a window. |
| 241 | ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
| 242 | |
| 243 | // The context_menu app has one context menu item. This, along with a |
| 244 | // separator and the developer tools, is all that should be in the menu. |
| 245 | WebContents* web_contents = GetFirstShellWindowWebContents(); |
| 246 | ASSERT_TRUE(web_contents); |
| 247 | WebKit::WebContextMenuData data; |
| 248 | content::ContextMenuParams params(data); |
| 249 | params.is_editable = true; |
[email protected] | 85d3d5e | 2012-08-31 21:19:17 | [diff] [blame] | 250 | scoped_ptr<PlatformAppContextMenu> menu; |
| 251 | menu.reset(new PlatformAppContextMenu(web_contents, params)); |
[email protected] | b3c019b | 2012-08-28 02:43:48 | [diff] [blame] | 252 | menu->Init(); |
| 253 | ASSERT_TRUE(menu->HasCommandWithId(IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST)); |
| 254 | ASSERT_TRUE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_INSPECTELEMENT)); |
[email protected] | 65992d5 | 2012-09-19 23:05:31 | [diff] [blame^] | 255 | ASSERT_TRUE( |
| 256 | menu->HasCommandWithId(IDC_CONTENT_CONTEXT_INSPECTBACKGROUNDPAGE)); |
[email protected] | b3c019b | 2012-08-28 02:43:48 | [diff] [blame] | 257 | ASSERT_TRUE(menu->HasCommandWithId(IDC_RELOAD)); |
| 258 | ASSERT_TRUE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_UNDO)); |
| 259 | ASSERT_TRUE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_COPY)); |
| 260 | ASSERT_FALSE(menu->HasCommandWithId(IDC_BACK)); |
| 261 | ASSERT_FALSE(menu->HasCommandWithId(IDC_SAVE_PAGE)); |
| 262 | } |
| 263 | |
| 264 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, AppWithContextMenuSelection) { |
| 265 | ExtensionTestMessageListener launched_listener("Launched", false); |
| 266 | LoadAndLaunchPlatformApp("context_menu"); |
| 267 | |
| 268 | // Wait for the extension to tell us it's initialized its context menus and |
| 269 | // launched a window. |
| 270 | ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
| 271 | |
| 272 | // The context_menu app has one context menu item. This, along with a |
| 273 | // separator and the developer tools, is all that should be in the menu. |
| 274 | WebContents* web_contents = GetFirstShellWindowWebContents(); |
| 275 | ASSERT_TRUE(web_contents); |
| 276 | WebKit::WebContextMenuData data; |
| 277 | content::ContextMenuParams params(data); |
| 278 | params.selection_text = ASCIIToUTF16("Hello World"); |
[email protected] | 85d3d5e | 2012-08-31 21:19:17 | [diff] [blame] | 279 | scoped_ptr<PlatformAppContextMenu> menu; |
| 280 | menu.reset(new PlatformAppContextMenu(web_contents, params)); |
[email protected] | b3c019b | 2012-08-28 02:43:48 | [diff] [blame] | 281 | menu->Init(); |
| 282 | ASSERT_TRUE(menu->HasCommandWithId(IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST)); |
| 283 | ASSERT_TRUE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_INSPECTELEMENT)); |
[email protected] | 65992d5 | 2012-09-19 23:05:31 | [diff] [blame^] | 284 | ASSERT_TRUE( |
| 285 | menu->HasCommandWithId(IDC_CONTENT_CONTEXT_INSPECTBACKGROUNDPAGE)); |
[email protected] | b3c019b | 2012-08-28 02:43:48 | [diff] [blame] | 286 | ASSERT_TRUE(menu->HasCommandWithId(IDC_RELOAD)); |
| 287 | ASSERT_FALSE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_UNDO)); |
| 288 | ASSERT_TRUE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_COPY)); |
| 289 | ASSERT_FALSE(menu->HasCommandWithId(IDC_BACK)); |
| 290 | ASSERT_FALSE(menu->HasCommandWithId(IDC_SAVE_PAGE)); |
[email protected] | 375003a | 2011-12-13 02:53:21 | [diff] [blame] | 291 | } |
[email protected] | 5f000f27 | 2012-01-19 05:25:08 | [diff] [blame] | 292 | |
[email protected] | dc83c58 | 2012-08-17 02:18:14 | [diff] [blame] | 293 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, AppWithContextMenuClicked) { |
| 294 | ExtensionTestMessageListener launched_listener("Launched", false); |
| 295 | LoadAndLaunchPlatformApp("context_menu_click"); |
| 296 | |
| 297 | // Wait for the extension to tell us it's initialized its context menus and |
| 298 | // launched a window. |
| 299 | ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
| 300 | |
| 301 | // Test that the menu item shows up |
| 302 | WebContents* web_contents = GetFirstShellWindowWebContents(); |
| 303 | ASSERT_TRUE(web_contents); |
| 304 | WebKit::WebContextMenuData data; |
| 305 | content::ContextMenuParams params(data); |
| 306 | params.page_url = GURL("http://foo.bar"); |
[email protected] | 85d3d5e | 2012-08-31 21:19:17 | [diff] [blame] | 307 | scoped_ptr<PlatformAppContextMenu> menu; |
| 308 | menu.reset(new PlatformAppContextMenu(web_contents, params)); |
[email protected] | dc83c58 | 2012-08-17 02:18:14 | [diff] [blame] | 309 | menu->Init(); |
| 310 | ASSERT_TRUE(menu->HasCommandWithId(IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST)); |
| 311 | |
| 312 | // Execute the menu item |
| 313 | ExtensionTestMessageListener onclicked_listener("onClicked fired for id1", |
| 314 | false); |
| 315 | menu->ExecuteCommand(IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST); |
| 316 | |
| 317 | ASSERT_TRUE(onclicked_listener.WaitUntilSatisfied()); |
| 318 | } |
| 319 | |
[email protected] | edd7ed69 | 2012-02-08 02:50:03 | [diff] [blame] | 320 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, DisallowNavigation) { |
[email protected] | dc37b00 | 2012-04-23 23:02:26 | [diff] [blame] | 321 | ASSERT_TRUE(StartTestServer()); |
| 322 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/navigation")) << message_; |
[email protected] | 5f000f27 | 2012-01-19 05:25:08 | [diff] [blame] | 323 | } |
[email protected] | 863e647 | 2012-01-24 19:33:58 | [diff] [blame] | 324 | |
[email protected] | fd3238af | 2012-05-22 18:55:30 | [diff] [blame] | 325 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, Iframes) { |
| 326 | ASSERT_TRUE(StartTestServer()); |
| 327 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/iframes")) << message_; |
| 328 | } |
| 329 | |
[email protected] | 2aac7ff | 2012-01-25 18:05:11 | [diff] [blame] | 330 | // Tests that localStorage and WebSQL are disabled for platform apps. |
[email protected] | edd7ed69 | 2012-02-08 02:50:03 | [diff] [blame] | 331 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, DisallowStorage) { |
[email protected] | 2aac7ff | 2012-01-25 18:05:11 | [diff] [blame] | 332 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/storage")) << message_; |
| 333 | } |
[email protected] | 6a5a2e5 | 2012-03-22 03:21:12 | [diff] [blame] | 334 | |
[email protected] | c0cecd1f | 2012-04-05 16:50:12 | [diff] [blame] | 335 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, Restrictions) { |
| 336 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/restrictions")) << message_; |
| 337 | } |
| 338 | |
[email protected] | f0233ff | 2012-07-20 20:14:50 | [diff] [blame] | 339 | // Tests that platform apps can use the chrome.app.window.* API. |
[email protected] | dc37b00 | 2012-04-23 23:02:26 | [diff] [blame] | 340 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, WindowsApi) { |
[email protected] | 6a5a2e5 | 2012-03-22 03:21:12 | [diff] [blame] | 341 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/windows_api")) << message_; |
| 342 | } |
[email protected] | 605fb810 | 2012-05-04 01:36:55 | [diff] [blame] | 343 | |
[email protected] | 1df2204 | 2012-08-30 19:48:55 | [diff] [blame] | 344 | // Tests that extensions can't use platform-app-only APIs. |
| 345 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, PlatformAppsOnly) { |
| 346 | ASSERT_TRUE(RunExtensionTestIgnoreManifestWarnings( |
| 347 | "platform_apps/apps_only")) << message_; |
| 348 | } |
| 349 | |
[email protected] | 605fb810 | 2012-05-04 01:36:55 | [diff] [blame] | 350 | // Tests that platform apps have isolated storage by default. |
| 351 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, Isolation) { |
| 352 | ASSERT_TRUE(StartTestServer()); |
| 353 | |
| 354 | // Load a (non-app) page under the "localhost" origin that sets a cookie. |
| 355 | GURL set_cookie_url = test_server()->GetURL( |
| 356 | "files/extensions/platform_apps/isolation/set_cookie.html"); |
| 357 | GURL::Replacements replace_host; |
| 358 | std::string host_str("localhost"); // Must stay in scope with replace_host. |
| 359 | replace_host.SetHostStr(host_str); |
| 360 | set_cookie_url = set_cookie_url.ReplaceComponents(replace_host); |
| 361 | |
| 362 | ui_test_utils::NavigateToURLWithDisposition( |
| 363 | browser(), set_cookie_url, |
| 364 | CURRENT_TAB, ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 365 | |
| 366 | // Make sure the cookie is set. |
| 367 | int cookie_size; |
| 368 | std::string cookie_value; |
| 369 | automation_util::GetCookies( |
| 370 | set_cookie_url, |
[email protected] | 52877dbc6 | 2012-06-29 22:22:03 | [diff] [blame] | 371 | chrome::GetWebContentsAt(browser(), 0), |
[email protected] | 605fb810 | 2012-05-04 01:36:55 | [diff] [blame] | 372 | &cookie_size, |
| 373 | &cookie_value); |
| 374 | ASSERT_EQ("testCookie=1", cookie_value); |
| 375 | |
| 376 | // Let the platform app request the same URL, and make sure that it doesn't |
| 377 | // see the cookie. |
| 378 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/isolation")) << message_; |
| 379 | } |
[email protected] | 31bdbfef | 2012-05-22 19:59:15 | [diff] [blame] | 380 | |
| 381 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, ExtensionWindowingApis) { |
| 382 | // Initially there should be just the one browser window visible to the |
| 383 | // extensions API. |
| 384 | const Extension* extension = LoadExtension( |
| 385 | test_data_dir_.AppendASCII("common/background_page")); |
| 386 | ASSERT_EQ(1U, RunGetWindowsFunctionForExtension(extension)); |
| 387 | |
| 388 | // And no shell windows. |
| 389 | ASSERT_EQ(0U, GetShellWindowCount()); |
| 390 | |
| 391 | // Launch a platform app that shows a window. |
| 392 | ExtensionTestMessageListener launched_listener("Launched", false); |
[email protected] | ad5bb8a9 | 2012-06-07 03:55:58 | [diff] [blame] | 393 | LoadAndLaunchPlatformApp("minimal"); |
[email protected] | 31bdbfef | 2012-05-22 19:59:15 | [diff] [blame] | 394 | ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
| 395 | ASSERT_EQ(1U, GetShellWindowCount()); |
| 396 | ShellWindowRegistry::ShellWindowSet shell_windows = |
| 397 | ShellWindowRegistry::Get(browser()->profile())->shell_windows(); |
| 398 | int shell_window_id = (*shell_windows.begin())->session_id().id(); |
| 399 | |
| 400 | // But it's not visible to the extensions API, it still thinks there's just |
| 401 | // one browser window. |
| 402 | ASSERT_EQ(1U, RunGetWindowsFunctionForExtension(extension)); |
| 403 | // It can't look it up by ID either |
| 404 | ASSERT_FALSE(RunGetWindowFunctionForExtension(shell_window_id, extension)); |
| 405 | |
| 406 | // The app can also only see one window (its own). |
[email protected] | ad5bb8a9 | 2012-06-07 03:55:58 | [diff] [blame] | 407 | // TODO(jeremya): add an extension function to get a shell window by ID, and |
| 408 | // to get a list of all the shell windows, so we can test this. |
[email protected] | 31bdbfef | 2012-05-22 19:59:15 | [diff] [blame] | 409 | |
| 410 | // Launch another platform app that also shows a window. |
| 411 | ExtensionTestMessageListener launched_listener2("Launched", false); |
[email protected] | ad5bb8a9 | 2012-06-07 03:55:58 | [diff] [blame] | 412 | LoadAndLaunchPlatformApp("context_menu"); |
[email protected] | 31bdbfef | 2012-05-22 19:59:15 | [diff] [blame] | 413 | ASSERT_TRUE(launched_listener2.WaitUntilSatisfied()); |
| 414 | |
| 415 | // There are two total shell windows, but each app can only see its own. |
| 416 | ASSERT_EQ(2U, GetShellWindowCount()); |
[email protected] | ad5bb8a9 | 2012-06-07 03:55:58 | [diff] [blame] | 417 | // TODO(jeremya): as above, this requires more extension functions. |
[email protected] | 31bdbfef | 2012-05-22 19:59:15 | [diff] [blame] | 418 | } |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 419 | |
| 420 | // TODO(benwells): fix these tests for ChromeOS. |
| 421 | #if !defined(OS_CHROMEOS) |
| 422 | // Tests that command line parameters get passed through to platform apps |
| 423 | // via launchData correctly when launching with a file. |
| 424 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithFile) { |
[email protected] | 85d3d5e | 2012-08-31 21:19:17 | [diff] [blame] | 425 | SetCommandLineArg(kTestFilePath); |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 426 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_file")) |
| 427 | << message_; |
| 428 | } |
| 429 | |
[email protected] | a5a0be0 | 2012-07-18 05:51:54 | [diff] [blame] | 430 | // Tests that relative paths can be passed through to the platform app. |
| 431 | // This test doesn't use the normal test infrastructure as it needs to open |
| 432 | // the application differently to all other platform app tests, by setting |
| 433 | // the application_launch::LaunchParams.current_directory field. |
| 434 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithRelativeFile) { |
| 435 | // Setup the command line |
| 436 | ClearCommandLineArgs(); |
| 437 | CommandLine* command_line = CommandLine::ForCurrentProcess(); |
[email protected] | 85d3d5e | 2012-08-31 21:19:17 | [diff] [blame] | 438 | FilePath relative_test_doc = FilePath::FromUTF8Unsafe(kTestFilePath); |
[email protected] | a5a0be0 | 2012-07-18 05:51:54 | [diff] [blame] | 439 | relative_test_doc = relative_test_doc.NormalizePathSeparators(); |
| 440 | command_line->AppendArgPath(relative_test_doc); |
| 441 | |
| 442 | // Load the extension |
| 443 | ResultCatcher catcher; |
[email protected] | d9ede58 | 2012-08-14 19:21:38 | [diff] [blame] | 444 | const Extension* extension = LoadExtension( |
[email protected] | a5a0be0 | 2012-07-18 05:51:54 | [diff] [blame] | 445 | test_data_dir_.AppendASCII("platform_apps/launch_file")); |
| 446 | ASSERT_TRUE(extension); |
| 447 | |
| 448 | // Run the test |
| 449 | application_launch::LaunchParams params(browser()->profile(), extension, |
| 450 | extension_misc::LAUNCH_NONE, |
| 451 | NEW_WINDOW); |
| 452 | params.command_line = CommandLine::ForCurrentProcess(); |
| 453 | params.current_directory = test_data_dir_; |
| 454 | application_launch::OpenApplication(params); |
| 455 | |
| 456 | if (!catcher.GetNextResult()) { |
| 457 | message_ = catcher.message(); |
| 458 | ASSERT_TRUE(0); |
| 459 | } |
| 460 | } |
| 461 | |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 462 | // Tests that no launch data is sent through if the platform app provides |
| 463 | // an intent with the wrong action. |
| 464 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithWrongIntent) { |
[email protected] | 85d3d5e | 2012-08-31 21:19:17 | [diff] [blame] | 465 | SetCommandLineArg(kTestFilePath); |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 466 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_wrong_intent")) |
| 467 | << message_; |
| 468 | } |
| 469 | |
| 470 | // Tests that no launch data is sent through if the file is of the wrong MIME |
| 471 | // type. |
| 472 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithWrongType) { |
[email protected] | 85d3d5e | 2012-08-31 21:19:17 | [diff] [blame] | 473 | SetCommandLineArg(kTestFilePath); |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 474 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_wrong_type")) |
| 475 | << message_; |
| 476 | } |
| 477 | |
| 478 | // Tests that no launch data is sent through if the platform app does not |
| 479 | // provide an intent. |
| 480 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithNoIntent) { |
[email protected] | 85d3d5e | 2012-08-31 21:19:17 | [diff] [blame] | 481 | SetCommandLineArg(kTestFilePath); |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 482 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_no_intent")) |
| 483 | << message_; |
| 484 | } |
| 485 | |
| 486 | // Tests that no launch data is sent through if the file MIME type cannot |
| 487 | // be read. |
| 488 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchNoType) { |
| 489 | SetCommandLineArg("platform_apps/launch_files/test.unknownextension"); |
| 490 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_invalid")) |
| 491 | << message_; |
| 492 | } |
| 493 | |
| 494 | // Tests that no launch data is sent through if the file does not exist. |
| 495 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchNoFile) { |
| 496 | SetCommandLineArg("platform_apps/launch_files/doesnotexist.txt"); |
| 497 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_invalid")) |
| 498 | << message_; |
| 499 | } |
| 500 | |
| 501 | // Tests that no launch data is sent through if the argument is a directory. |
| 502 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithDirectory) { |
| 503 | SetCommandLineArg("platform_apps/launch_files"); |
| 504 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_invalid")) |
| 505 | << message_; |
| 506 | } |
| 507 | |
| 508 | // Tests that no launch data is sent through if there are no arguments passed |
| 509 | // on the command line |
| 510 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, LaunchWithNothing) { |
| 511 | ClearCommandLineArgs(); |
| 512 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/launch_nothing")) |
| 513 | << message_; |
| 514 | } |
[email protected] | ffc7b4d | 2012-06-08 00:05:32 | [diff] [blame] | 515 | |
| 516 | // Test that platform apps can use the chrome.fileSystem.getDisplayPath |
| 517 | // function to get the native file system path of a file they are launched with. |
| 518 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, GetDisplayPath) { |
[email protected] | 85d3d5e | 2012-08-31 21:19:17 | [diff] [blame] | 519 | SetCommandLineArg(kTestFilePath); |
[email protected] | ffc7b4d | 2012-06-08 00:05:32 | [diff] [blame] | 520 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/get_display_path")) |
| 521 | << message_; |
| 522 | } |
| 523 | |
[email protected] | 12e54045 | 2012-05-26 07:09:36 | [diff] [blame] | 524 | #endif // defined(OS_CHROMEOS) |
[email protected] | 5b1a04b4 | 2012-06-15 00:41:44 | [diff] [blame] | 525 | |
| 526 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, OpenLink) { |
| 527 | ASSERT_TRUE(StartTestServer()); |
[email protected] | a7fe911 | 2012-07-20 02:34:45 | [diff] [blame] | 528 | content::WindowedNotificationObserver observer( |
[email protected] | 5b1a04b4 | 2012-06-15 00:41:44 | [diff] [blame] | 529 | chrome::NOTIFICATION_TAB_ADDED, |
| 530 | content::Source<content::WebContentsDelegate>(browser())); |
| 531 | LoadAndLaunchPlatformApp("open_link"); |
| 532 | observer.Wait(); |
| 533 | ASSERT_EQ(2, browser()->tab_count()); |
| 534 | } |
[email protected] | d9ede58 | 2012-08-14 19:21:38 | [diff] [blame] | 535 | |
[email protected] | 3a8e6194 | 2012-08-23 01:46:45 | [diff] [blame] | 536 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, MutationEventsDisabled) { |
| 537 | ASSERT_TRUE(RunPlatformAppTest("platform_apps/mutation_events")) << message_; |
| 538 | } |
| 539 | |
[email protected] | 939532d0 | 2012-08-31 23:37:33 | [diff] [blame] | 540 | // Test that windows created with an id will remember and restore their |
| 541 | // geometry when opening new windows. |
| 542 | IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, ShellWindowRestorePosition) { |
| 543 | ExtensionTestMessageListener page2_listener("WaitForPage2", true); |
| 544 | ExtensionTestMessageListener page3_listener("WaitForPage3", true); |
| 545 | ExtensionTestMessageListener done_listener("Done1", false); |
| 546 | ExtensionTestMessageListener done2_listener("Done2", false); |
| 547 | ExtensionTestMessageListener done3_listener("Done3", false); |
| 548 | |
| 549 | ASSERT_TRUE(LoadAndLaunchPlatformApp("geometry")); |
| 550 | |
| 551 | // Wait for the app to be launched (although this is mostly to have a |
| 552 | // message to reply to to let the script know it should create its second |
| 553 | // window. |
| 554 | ASSERT_TRUE(page2_listener.WaitUntilSatisfied()); |
| 555 | |
| 556 | // Wait for the first window to verify its geometry was correctly set |
| 557 | // from the default* attributes passed to the create function. |
| 558 | ASSERT_TRUE(done_listener.WaitUntilSatisfied()); |
| 559 | |
| 560 | // Programatically move and resize the window. |
| 561 | ShellWindow* window = GetFirstShellWindow(); |
| 562 | ASSERT_TRUE(window); |
| 563 | gfx::Rect bounds(137, 143, 203, 187); |
| 564 | window->GetBaseWindow()->SetBounds(bounds); |
| 565 | |
| 566 | #if defined(TOOLKIT_GTK) |
| 567 | // TODO(mek): On GTK we have to wait for a roundtrip to the X server before |
| 568 | // a resize actually happens: |
| 569 | // "if you call gtk_window_resize() then immediately call |
| 570 | // gtk_window_get_size(), the size won't have taken effect yet. After the |
| 571 | // window manager processes the resize request, GTK+ receives notification |
| 572 | // that the size has changed via a configure event, and the size of the |
| 573 | // window gets updated." |
| 574 | // Because of this we have to wait for an unknown time for the resize to |
| 575 | // actually take effect. So wait some time or until the resize got |
| 576 | // handled. |
| 577 | base::TimeTicks end_time = base::TimeTicks::Now() + |
| 578 | TestTimeouts::action_timeout(); |
| 579 | while (base::TimeTicks::Now() < end_time && |
| 580 | bounds != window->GetBaseWindow()->GetBounds()) { |
| 581 | content::RunAllPendingInMessageLoop(); |
| 582 | } |
| 583 | |
| 584 | // In the GTK ShellWindow implementation there also is a delay between |
| 585 | // getting the correct bounds and it calling SaveWindowPosition, so call that |
| 586 | // method explicitly to make sure the value was stored. |
| 587 | window->SaveWindowPosition(); |
| 588 | #endif // defined(TOOLKIT_GTK) |
| 589 | |
| 590 | // Make sure the window was properly moved&resized. |
| 591 | ASSERT_EQ(bounds, window->GetBaseWindow()->GetBounds()); |
| 592 | |
| 593 | // Tell javascript to open a second window. |
| 594 | page2_listener.Reply("continue"); |
| 595 | |
| 596 | // Wait for javascript to verify that the second window got the updated |
| 597 | // coordinates, ignoring the default coordinates passed to the create method. |
| 598 | ASSERT_TRUE(done2_listener.WaitUntilSatisfied()); |
| 599 | |
| 600 | // Tell javascript to open a third window. |
| 601 | page3_listener.Reply("continue"); |
| 602 | |
| 603 | // Wait for javascript to verify that the third window got the restored size |
| 604 | // and explicitly specified coordinates. |
| 605 | ASSERT_TRUE(done3_listener.WaitUntilSatisfied()); |
| 606 | } |
[email protected] | 939532d0 | 2012-08-31 23:37:33 | [diff] [blame] | 607 | |
[email protected] | d9ede58 | 2012-08-14 19:21:38 | [diff] [blame] | 608 | } // namespace extensions |