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

Unified Diff: chrome/browser/extensions/platform_app_browsertest.cc

Issue 18192003: Add tests for ShellWindowLinkDelegate::OpenURLFromTab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/platform_app_browsertest.cc
diff --git a/chrome/browser/extensions/platform_app_browsertest.cc b/chrome/browser/extensions/platform_app_browsertest.cc
index 28168bbb9c799a62f517ff005b78031bb387bdcd..fd4aa2b27c1b72e7065c164b13daf52005186053 100644
--- a/chrome/browser/extensions/platform_app_browsertest.cc
+++ b/chrome/browser/extensions/platform_app_browsertest.cc
@@ -27,6 +27,7 @@
#include "chrome/browser/extensions/platform_app_launcher.h"
#include "chrome/browser/extensions/shell_window_registry.h"
#include "chrome/browser/tab_contents/render_view_context_menu.h"
+#include "chrome/browser/ui/apps/chrome_shell_window_delegate.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/extensions/application_launch.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
@@ -606,6 +607,15 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, GetDisplayPath) {
<< message_;
}
+// Test that ShellWindowLinkDelegate::OpenURLFromTab doesn't crash. This code
+// relies on the WebContents implementation not dereferencing the Source
+// WebContents after ShellWindowLinkDelegate frees it.
+IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, ExternalOpenLink) {
+ chrome::ChromeShellWindowDelegate::EnableExternalOpenForTesting();
+ ASSERT_TRUE(RunPlatformAppTest("platform_apps/external_open_link"));
+ chrome::ChromeShellWindowDelegate::DisableExternalOpenForTesting();
+}
+
Ken Rockot(use gerrit already) 2013/07/01 15:02:54 First, this is not the right test for the associat
zhchbin 2013/07/02 08:59:06 Sorry for my mistake first of all. However, when d
#endif // defined(OS_CHROMEOS)
IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, OpenLink) {

Powered by Google App Engine
This is Rietveld 408576698