summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/signin/logout_tab_helper_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/signin/logout_tab_helper_unittest.cc')
-rw-r--r--chromium/chrome/browser/signin/logout_tab_helper_unittest.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/chromium/chrome/browser/signin/logout_tab_helper_unittest.cc b/chromium/chrome/browser/signin/logout_tab_helper_unittest.cc
new file mode 100644
index 00000000000..7717ade215c
--- /dev/null
+++ b/chromium/chrome/browser/signin/logout_tab_helper_unittest.cc
@@ -0,0 +1,24 @@
+// Copyright 2021 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/signin/logout_tab_helper.h"
+
+#include "chrome/test/base/chrome_render_view_host_test_harness.h"
+#include "content/public/test/navigation_simulator.h"
+#include "google_apis/gaia/gaia_urls.h"
+
+class LogoutTabHelperTest : public ChromeRenderViewHostTestHarness {};
+
+TEST_F(LogoutTabHelperTest, SelfDeleteInPrimaryPageChanged) {
+ LogoutTabHelper::CreateForWebContents(web_contents());
+
+ EXPECT_NE(nullptr, LogoutTabHelper::FromWebContents(web_contents()));
+
+ // Load the logout page.
+ content::NavigationSimulator::NavigateAndCommitFromBrowser(
+ web_contents(), GaiaUrls::GetInstance()->service_logout_url());
+
+ // The helper was deleted in PrimaryPageChanged.
+ EXPECT_EQ(nullptr, LogoutTabHelper::FromWebContents(web_contents()));
+}