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

Unified Diff: chrome/browser/ui/intents/web_intent_picker_controller_browsertest.cc

Issue 9805005: [Web Intents] Fix crash when invoking intent in incognito mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 9 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
« no previous file with comments | « chrome/browser/ui/intents/web_intent_picker_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/intents/web_intent_picker_controller_browsertest.cc
diff --git a/chrome/browser/ui/intents/web_intent_picker_controller_browsertest.cc b/chrome/browser/ui/intents/web_intent_picker_controller_browsertest.cc
index 9dab1d2993f0a1fdc1d0a635a922a45bf55dca59..e7d20f713d75aef771476ef581ac900395c917ac 100644
--- a/chrome/browser/ui/intents/web_intent_picker_controller_browsertest.cc
+++ b/chrome/browser/ui/intents/web_intent_picker_controller_browsertest.cc
@@ -192,10 +192,10 @@ class WebIntentPickerControllerBrowserTest : public InProcessBrowserTest {
new FakeURLFetcherFactory(default_url_fetcher_factory_.get()));
web_data_service_ =
- browser()->profile()->GetWebDataService(Profile::EXPLICIT_ACCESS);
+ GetBrowser()->profile()->GetWebDataService(Profile::EXPLICIT_ACCESS);
favicon_service_ =
- browser()->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS);
- controller_ = browser()->
+ GetBrowser()->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS);
+ controller_ = GetBrowser()->
GetSelectedTabContentsWrapper()->web_intent_picker_controller();
controller_->set_picker(&picker_);
@@ -204,6 +204,8 @@ class WebIntentPickerControllerBrowserTest : public InProcessBrowserTest {
CreateFakeIcon();
}
+ virtual Browser* GetBrowser() { return browser(); }
+
void AddWebIntentService(const string16& action, const GURL& service_url) {
webkit_glue::WebIntentServiceData service;
service.action = action;
@@ -356,3 +358,28 @@ IN_PROC_BROWSER_TEST_F(WebIntentPickerControllerBrowserTest,
ASSERT_EQ(2, browser()->tab_count());
EXPECT_EQ(original, browser()->GetSelectedWebContents()->GetURL());
}
+
+class WebIntentPickerControllerIncognitoBrowserTest :
+ public WebIntentPickerControllerBrowserTest {
+ public:
+ WebIntentPickerControllerIncognitoBrowserTest() {}
+
+ virtual void SetUpOnMainThread() OVERRIDE {
+ incognito_browser_ = CreateIncognitoBrowser();
+ WebIntentPickerControllerBrowserTest::SetUpOnMainThread();
+ }
+
+ virtual Browser* GetBrowser() OVERRIDE { return incognito_browser_; }
+
+ int pending_async_count() { return controller_->pending_async_count_; }
+
+ private:
+ Browser* incognito_browser_;
+};
+
+IN_PROC_BROWSER_TEST_F(WebIntentPickerControllerIncognitoBrowserTest,
+ ShowDialogShouldntCrash) {
+ controller_->ShowDialog(GetBrowser(), kAction1, kType);
+ // This should do nothing for now.
+ EXPECT_EQ(0, pending_async_count());
+}
« no previous file with comments | « chrome/browser/ui/intents/web_intent_picker_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698