Commit 1308b111 authored by Karan Bhatia's avatar Karan Bhatia Committed by Commit Bot

CTS: Fix BrowserActionsBarIncognitoTest.IncognitoMode with RuntimeHostPermissions feature.

Currently BrowserActionsBarIncognitoTest.IncognitoMode crashes when the
RuntimeHostPermissions feature is enabled since the test calls
ExtensionActionViewController::GetIcon with a null web-contents. This ends up
calling ExtensionActionViewController::GetPageInteractionStatus() which accesses
the null web-contents.

Fix this by using InProcessBrowserTest::CreateBrowser which waits for the
browser to have a valid tab.

BUG=888158

Change-Id: I7b763ff54f2a0d65e199582a9ab00549e549f8c0
Reviewed-on: https://chromium-review.googlesource.com/1239458
Commit-Queue: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593719}
parent 22fb320e
...@@ -664,9 +664,7 @@ IN_PROC_BROWSER_TEST_F(BrowserActionsBarIncognitoTest, IncognitoMode) { ...@@ -664,9 +664,7 @@ IN_PROC_BROWSER_TEST_F(BrowserActionsBarIncognitoTest, IncognitoMode) {
const extensions::Extension* extension = LoadExtensionIncognito( const extensions::Extension* extension = LoadExtensionIncognito(
test_data_dir_.AppendASCII("api_test/browser_action_with_icon")); test_data_dir_.AppendASCII("api_test/browser_action_with_icon"));
ASSERT_TRUE(extension); ASSERT_TRUE(extension);
Browser* second_browser = Browser* second_browser = CreateBrowser(profile()->GetOriginalProfile());
new Browser(Browser::CreateParams(profile()->GetOriginalProfile(), true));
base::RunLoop().RunUntilIdle();
EXPECT_FALSE(second_browser->profile()->IsOffTheRecord()); EXPECT_FALSE(second_browser->profile()->IsOffTheRecord());
CloseBrowserSynchronously(browser()); CloseBrowserSynchronously(browser());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment