OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/launcher.h" | 5 #include "apps/launcher.h" |
6 #include "apps/shell_window.h" | 6 #include "apps/shell_window.h" |
7 #include "apps/shell_window_registry.h" | 7 #include "apps/shell_window_registry.h" |
8 #include "apps/ui/native_app_window.h" | 8 #include "apps/ui/native_app_window.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 326 |
327 // Wait for the extension to tell us it's initialized its context menus and | 327 // Wait for the extension to tell us it's initialized its context menus and |
328 // launched a window. | 328 // launched a window. |
329 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); | 329 ASSERT_TRUE(launched_listener.WaitUntilSatisfied()); |
330 | 330 |
331 // The context_menu app has one context menu item. This, along with a | 331 // The context_menu app has one context menu item. This, along with a |
332 // separator and the developer tools, is all that should be in the menu. | 332 // separator and the developer tools, is all that should be in the menu. |
333 WebContents* web_contents = GetFirstShellWindowWebContents(); | 333 WebContents* web_contents = GetFirstShellWindowWebContents(); |
334 ASSERT_TRUE(web_contents); | 334 ASSERT_TRUE(web_contents); |
335 content::ContextMenuParams params; | 335 content::ContextMenuParams params; |
336 params.selection_text = ASCIIToUTF16("Hello World"); | 336 params.selection_text = base::ASCIIToUTF16("Hello World"); |
337 scoped_ptr<PlatformAppContextMenu> menu; | 337 scoped_ptr<PlatformAppContextMenu> menu; |
338 menu.reset(new PlatformAppContextMenu(web_contents, params)); | 338 menu.reset(new PlatformAppContextMenu(web_contents, params)); |
339 menu->Init(); | 339 menu->Init(); |
340 ASSERT_TRUE(menu->HasCommandWithId(IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST)); | 340 ASSERT_TRUE(menu->HasCommandWithId(IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST)); |
341 ASSERT_TRUE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_INSPECTELEMENT)); | 341 ASSERT_TRUE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_INSPECTELEMENT)); |
342 ASSERT_TRUE( | 342 ASSERT_TRUE( |
343 menu->HasCommandWithId(IDC_CONTENT_CONTEXT_INSPECTBACKGROUNDPAGE)); | 343 menu->HasCommandWithId(IDC_CONTENT_CONTEXT_INSPECTBACKGROUNDPAGE)); |
344 ASSERT_TRUE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_RELOAD_PACKAGED_APP)); | 344 ASSERT_TRUE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_RELOAD_PACKAGED_APP)); |
345 ASSERT_FALSE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_UNDO)); | 345 ASSERT_FALSE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_UNDO)); |
346 ASSERT_TRUE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_COPY)); | 346 ASSERT_TRUE(menu->HasCommandWithId(IDC_CONTENT_CONTEXT_COPY)); |
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 false); | 1287 false); |
1288 ASSERT_TRUE(restart_requested_listener.WaitUntilSatisfied()); | 1288 ASSERT_TRUE(restart_requested_listener.WaitUntilSatisfied()); |
1289 | 1289 |
1290 EXPECT_EQ(1, request_restart_call_count()); | 1290 EXPECT_EQ(1, request_restart_call_count()); |
1291 } | 1291 } |
1292 | 1292 |
1293 #endif // defined(OS_CHROMEOS) | 1293 #endif // defined(OS_CHROMEOS) |
1294 | 1294 |
1295 | 1295 |
1296 } // namespace extensions | 1296 } // namespace extensions |
OLD | NEW |