Commit 992d30d6 authored by Lu Huang's avatar Lu Huang Committed by Commit Bot

Add test to check pwa install icon when adding input to omnibox.

The pwa install icon should not be visible when the user is adding input to the omnibox. http://crrev.com/c/1933852 made this the default behavior for all page action icons. This change adds a specific test for the PwaInstallView icon view.

Bug: 969902
Change-Id: I6cd4fa495f70fefaf228771a2d8fd706e88f88e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1975155Reviewed-by: default avatarAlan Cutter <alancutter@chromium.org>
Reviewed-by: default avatarLorne Mitchell <lomitch@microsoft.com>
Commit-Queue: Lorne Mitchell <lomitch@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#726592}
parent ec28eb86
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h" #include "chrome/test/base/ui_test_utils.h"
#include "components/omnibox/browser/omnibox_popup_model.h"
#include "components/omnibox/browser/omnibox_view.h"
#include "content/public/common/referrer.h" #include "content/public/common/referrer.h"
#include "extensions/browser/extension_system.h" #include "extensions/browser/extension_system.h"
#include "net/test/embedded_test_server/http_request.h" #include "net/test/embedded_test_server/http_request.h"
...@@ -302,6 +304,20 @@ IN_PROC_BROWSER_TEST_F(PwaInstallViewBrowserTest, LabelAnimation) { ...@@ -302,6 +304,20 @@ IN_PROC_BROWSER_TEST_F(PwaInstallViewBrowserTest, LabelAnimation) {
EXPECT_FALSE(pwa_install_view_->is_animating_label()); EXPECT_FALSE(pwa_install_view_->is_animating_label());
} }
// Tests that the plus icon becomes invisible when the user is typing in the
// omnibox.
IN_PROC_BROWSER_TEST_F(PwaInstallViewBrowserTest, InputInOmnibox) {
StartNavigateToUrl(GetInstallableAppURL());
ASSERT_TRUE(app_banner_manager_->WaitForInstallableCheck());
EXPECT_TRUE(pwa_install_view_->GetVisible());
BrowserView* browser_view = BrowserView::GetBrowserViewForBrowser(browser());
LocationBar* location_bar = browser_view->GetLocationBarView();
OmniboxView* omnibox_view = location_bar->GetOmniboxView();
omnibox_view->model()->SetInputInProgress(true);
EXPECT_FALSE(pwa_install_view_->GetVisible());
}
// Tests that the icon persists while loading the same scope and omits running // Tests that the icon persists while loading the same scope and omits running
// the label animation again. // the label animation again.
IN_PROC_BROWSER_TEST_F(PwaInstallViewBrowserTest, NavigateToSameScope) { IN_PROC_BROWSER_TEST_F(PwaInstallViewBrowserTest, NavigateToSameScope) {
......
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