Commit 17770f53 authored by Nicholas Verne's avatar Nicholas Verne Committed by Commit Bot

Add browser_test for omitting terminal app from session restore.

Bug: 1062113
Change-Id: I7c2f9b00f3a5a0385b534fe20f50a9f20321b3b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2105663
Auto-Submit: Nicholas Verne <nverne@chromium.org>
Reviewed-by: default avatarJoel Hockey <joelhockey@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#752033}
parent 457cbfbe
...@@ -10,12 +10,14 @@ ...@@ -10,12 +10,14 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/crostini/crostini_util.h"
#include "chrome/browser/defaults.h" #include "chrome/browser/defaults.h"
#include "chrome/browser/prefs/session_startup_pref.h" #include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/web_applications/components/web_app_helpers.h"
#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths.h"
#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"
...@@ -275,3 +277,23 @@ IN_PROC_BROWSER_TEST_F(SessionRestoreTestChromeOS, RestoreMinimized) { ...@@ -275,3 +277,23 @@ IN_PROC_BROWSER_TEST_F(SessionRestoreTestChromeOS, RestoreMinimized) {
// desktop. // desktop.
EXPECT_NE(2u, minimized_count); EXPECT_NE(2u, minimized_count);
} }
IN_PROC_BROWSER_TEST_F(SessionRestoreTestChromeOS, PRE_OmitTerminalApp) {
const std::string terminal_app_name =
web_app::GenerateApplicationNameFromAppId(crostini::GetTerminalId());
CreateBrowserWithParams(CreateParamsForApp(test_app_name1, true));
CreateBrowserWithParams(CreateParamsForApp(terminal_app_name, true));
TurnOnSessionRestore();
}
IN_PROC_BROWSER_TEST_F(SessionRestoreTestChromeOS, OmitTerminalApp) {
const std::string terminal_app_name =
web_app::GenerateApplicationNameFromAppId(crostini::GetTerminalId());
size_t total_count = 0;
for (auto* browser : *BrowserList::GetInstance()) {
++total_count;
EXPECT_NE(terminal_app_name, browser->app_name());
}
// We should only count browser() and test_app_name1.
EXPECT_EQ(2u, total_count);
}
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