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

Side by Side Diff: chrome/browser/extensions/platform_app_browsertest.cc

Issue 10534147: Allow platform apps to open links in the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review feedback Created 8 years, 6 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/browser/ui/extensions/shell_window.h » ('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 "chrome/app/chrome_command_ids.h" 5 #include "chrome/app/chrome_command_ids.h"
6 #include "chrome/browser/automation/automation_util.h" 6 #include "chrome/browser/automation/automation_util.h"
7 #include "chrome/browser/tab_contents/render_view_context_menu.h" 7 #include "chrome/browser/tab_contents/render_view_context_menu.h"
8 #include "chrome/browser/extensions/extension_test_message_listener.h" 8 #include "chrome/browser/extensions/extension_test_message_listener.h"
9 #include "chrome/browser/extensions/platform_app_browsertest_util.h" 9 #include "chrome/browser/extensions/platform_app_browsertest_util.h"
10 #include "chrome/browser/extensions/shell_window_registry.h" 10 #include "chrome/browser/extensions/shell_window_registry.h"
11 #include "chrome/browser/ui/browser.h" 11 #include "chrome/browser/ui/browser.h"
12 #include "chrome/browser/ui/extensions/shell_window.h" 12 #include "chrome/browser/ui/extensions/shell_window.h"
13 #include "chrome/common/chrome_notification_types.h"
13 #include "chrome/test/base/ui_test_utils.h" 14 #include "chrome/test/base/ui_test_utils.h"
14 15
15 using content::WebContents; 16 using content::WebContents;
16 using extensions::Extension; 17 using extensions::Extension;
17 18
18 namespace { 19 namespace {
19 // Non-abstract RenderViewContextMenu class. 20 // Non-abstract RenderViewContextMenu class.
20 class PlatformAppContextMenu : public RenderViewContextMenu { 21 class PlatformAppContextMenu : public RenderViewContextMenu {
21 public: 22 public:
22 PlatformAppContextMenu(WebContents* web_contents, 23 PlatformAppContextMenu(WebContents* web_contents,
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 251
251 // Test that platform apps can use the chrome.fileSystem.getDisplayPath 252 // Test that platform apps can use the chrome.fileSystem.getDisplayPath
252 // function to get the native file system path of a file they are launched with. 253 // function to get the native file system path of a file they are launched with.
253 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, GetDisplayPath) { 254 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, GetDisplayPath) {
254 SetCommandLineArg("platform_apps/launch_files/test.txt"); 255 SetCommandLineArg("platform_apps/launch_files/test.txt");
255 ASSERT_TRUE(RunPlatformAppTest("platform_apps/get_display_path")) 256 ASSERT_TRUE(RunPlatformAppTest("platform_apps/get_display_path"))
256 << message_; 257 << message_;
257 } 258 }
258 259
259 #endif // defined(OS_CHROMEOS) 260 #endif // defined(OS_CHROMEOS)
261
262 IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, OpenLink) {
263 ASSERT_TRUE(StartTestServer());
264 ui_test_utils::WindowedNotificationObserver observer(
265 chrome::NOTIFICATION_TAB_ADDED,
266 content::Source<content::WebContentsDelegate>(browser()));
267 LoadAndLaunchPlatformApp("open_link");
268 observer.Wait();
269 ASSERT_EQ(2, browser()->tab_count());
270 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/extensions/shell_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698