Commit 3fec5f63 authored by Nicholas Verne's avatar Nicholas Verne Committed by Commit Bot

De-flake Crostini browser tests.

Using a FakeCrostiniFeatures with all options on "true" removes flakes.

Bug: 1059771
Change-Id: I5beeea945dd2f38e857c95e808119643e8081b27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2094918
Commit-Queue: David Munro <davidmunro@google.com>
Reviewed-by: default avatarDavid Munro <davidmunro@google.com>
Cr-Commit-Position: refs/heads/master@{#748496}
parent 85bf986d
......@@ -12,6 +12,7 @@
#include "chrome/browser/chrome_browser_main_extra_parts.h"
#include "chrome/browser/chromeos/crostini/crostini_pref_names.h"
#include "chrome/browser/chromeos/crostini/crostini_util.h"
#include "chrome/browser/chromeos/crostini/fake_crostini_features.h"
#include "chrome/browser/component_updater/fake_cros_component_manager.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_features.h"
......@@ -88,6 +89,12 @@ class CrostiniBrowserTestChromeBrowserMainExtraParts
CrostiniDialogBrowserTest::CrostiniDialogBrowserTest(bool register_termina)
: register_termina_(register_termina) {
scoped_feature_list_.InitAndEnableFeature(features::kCrostini);
fake_crostini_features_.set_allowed(true);
fake_crostini_features_.set_ui_allowed(true);
fake_crostini_features_.set_enabled(true);
fake_crostini_features_.set_export_import_ui_allowed(true);
fake_crostini_features_.set_root_access_allowed(true);
fake_crostini_features_.container_upgrade_ui_allowed(true);
}
CrostiniDialogBrowserTest::~CrostiniDialogBrowserTest() = default;
......
......@@ -8,6 +8,7 @@
#include <memory>
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/chromeos/crostini/fake_crostini_features.h"
#include "chrome/browser/ui/test/test_browser_dialog.h"
#include "chrome/test/base/browser_process_platform_part_test_api_chromeos.h"
#include "services/network/public/mojom/network_change_manager.mojom-forward.h"
......@@ -35,6 +36,7 @@ class CrostiniDialogBrowserTest : public DialogBrowserTest {
const bool register_termina_;
base::test::ScopedFeatureList scoped_feature_list_;
crostini::FakeCrostiniFeatures fake_crostini_features_;
// Owned by content::Browser
CrostiniBrowserTestChromeBrowserMainExtraParts* extra_parts_ = nullptr;
......
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