forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently for lacros browser tests, shared ash chrome was started and used by tests. But there are user cases that a feature needs to be enabled in ash, then we can test some lacros behavior. This change makes writing such test cases possible. The ideal usage would be: 1 Developer developing an ash feature behind a flag. 2 Write a browser test using StartUniqueAshChrome with the feature on. 3 After the feature is on by default, remove the feature flag and switch to the shared ash chrome. Bug: 1368284 Change-Id: I472458ca7f894822965fbb4bc2013417f4dcf55f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4292072 Reviewed-by: Erik Chen <erikchen@chromium.org> Reviewed-by: Jenny Zhang <jennyz@chromium.org> Commit-Queue: Sven Zheng <svenzheng@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org> Cr-Commit-Position: refs/heads/main@{#1111887}
- Loading branch information
Sven Zheng
authored and
Chromium LUCI CQ
committed
Mar 1, 2023
1 parent
6755ada
commit 7379305
Showing
6 changed files
with
180 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
chrome/test/base/in_process_browser_test_browsertest_lacros.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "chrome/test/base/in_process_browser_test.h" | ||
|
||
#include "content/public/test/browser_test.h" | ||
#include "testing/gtest/include/gtest/gtest.h" | ||
|
||
// TODO(crbug.com/1368284): Remove this test when there are more use cases | ||
// to verify the start ash chrome logic. | ||
class StartUniqueAshBrowserTest : public InProcessBrowserTest { | ||
public: | ||
void SetUp() override { | ||
// Need to put this before starting lacros. | ||
StartUniqueAshChrome({}, {}, {"random-unused-example-cmdline"}, | ||
"Reason:Test"); | ||
InProcessBrowserTest::SetUp(); | ||
} | ||
|
||
void CheckExpectations() { EXPECT_TRUE(ash_process_.IsValid()); } | ||
}; | ||
|
||
IN_PROC_BROWSER_TEST_F(StartUniqueAshBrowserTest, StartAshChrome) { | ||
CheckExpectations(); | ||
} |