From 9dbfc2d126ff0ecd1ff5d61e285b63e0cd6de515 Mon Sep 17 00:00:00 2001 From: Max Karolinskiy Date: Wed, 8 Sep 2021 22:29:20 -0400 Subject: [PATCH] Revert "Merge pull request #9849 from brave/cr93_first_run_regression" This reverts commit 0b78f9e1fcb5c68796b5f4f15f0c424a694bc0e1, reversing changes made to d260b6aa38919b6ff46c999e55510c072ef49658. Reverting because upstream has fixed the first run regression via: https://chromium.googlesource.com/chromium/src.git/+/f9385e0d893916cbb16b477bdec127e56f9897da Cherry-picked into cr94 as https://chromium.googlesource.com/chromium/src/+/3f20e2edeb0adf78a6a9a6208e2e02ad3c7d8810 commit f9385e0d893916cbb16b477bdec127e56f9897da Author: Caitlin Fischer Date: Mon Aug 30 13:31:02 2021 +0000 Ignore Local State when deciding whether to show the first run dialog. The bug was caused by an experiment that causes Local State to be written to disk during startup (before the first-run-dialog-showing logic is reached) on some clients. Since Local State existed on some clients, the dialog was not shown. However, the first-run-dialog-showing logic should not depend on the presence or absence of a Local State file. This change affects some POSIX platforms running Google Chrome for the first time. This logic being removed was originally added here: https://chromiumcodereview.appspot.com/14946003/. Bug: 1221483 --- .../first_run/first_run_internal_posix.cc | 2 -- common/BUILD.gn | 15 --------------- common/brave_paths_unittest.cc | 16 ---------------- test/BUILD.gn | 1 - 4 files changed, 34 deletions(-) delete mode 100644 common/brave_paths_unittest.cc diff --git a/chromium_src/chrome/browser/first_run/first_run_internal_posix.cc b/chromium_src/chrome/browser/first_run/first_run_internal_posix.cc index e4caa4fe07e8..27be1abcf61b 100644 --- a/chromium_src/chrome/browser/first_run/first_run_internal_posix.cc +++ b/chromium_src/chrome/browser/first_run/first_run_internal_posix.cc @@ -32,10 +32,8 @@ #if defined(OFFICIAL_BUILD) #undef BUILDFLAG_INTERNAL_GOOGLE_CHROME_BRANDING #define BUILDFLAG_INTERNAL_GOOGLE_CHROME_BRANDING() (1) -#define FILE_LOCAL_STATE PATH_END #endif #include "../../../../../chrome/browser/first_run/first_run_internal_posix.cc" #if defined(OFFICIAL_BUILD) #undef BUILDFLAG_INTERNAL_GOOGLE_CHROME_BRANDING -#undef FILE_LOCAL_STATE #endif diff --git a/common/BUILD.gn b/common/BUILD.gn index 96ad4575d3a4..1458f9dd312a 100644 --- a/common/BUILD.gn +++ b/common/BUILD.gn @@ -185,21 +185,6 @@ config("constants_configs") { } } -source_set("unit_tests") { - testonly = true - - if (!is_ios) { - sources = [ "brave_paths_unittest.cc" ] - - deps = [ - "//base", - "//brave/common", - "//chrome/common", - "//testing/gtest", - ] - } -} - mojom("mojo_bindings") { sources = [ "brave_renderer_configuration.mojom" ] diff --git a/common/brave_paths_unittest.cc b/common/brave_paths_unittest.cc deleted file mode 100644 index af3a43b2bd77..000000000000 --- a/common/brave_paths_unittest.cc +++ /dev/null @@ -1,16 +0,0 @@ -/* Copyright (c) 2021 The Brave Authors. All rights reserved. - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "brave/common/brave_paths.h" -#include "base/files/file_path.h" -#include "base/path_service.h" -#include "chrome/common/chrome_paths.h" -#include "testing/gtest/include/gtest/gtest.h" - -TEST(BravePathsTest, PathTest) { - base::FilePath test_dir; - EXPECT_TRUE(base::PathService::Get(brave::DIR_TEST_DATA, &test_dir)); - EXPECT_FALSE(base::PathService::Get(chrome::PATH_END, &test_dir)); -} diff --git a/test/BUILD.gn b/test/BUILD.gn index 31cba0fb09cf..99426571c523 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -178,7 +178,6 @@ test("brave_unit_tests") { "//brave/chromium_src/components/autofill_assistant/browser:unit_tests", "//brave/common:network_constants", "//brave/common:pref_names", - "//brave/common:unit_tests", "//brave/components/adblock_rust_ffi", "//brave/components/brave_adaptive_captcha/buildflags", "//brave/components/brave_ads/test:brave_ads_unit_tests",