Commit 242fe9d5 authored by Caleb Rouleau's avatar Caleb Rouleau

Revert "Fixed first_run test failure because of the global variables"

This reverts commit 8d01fd2f.

Reason for revert: crbug.com/822316 looks like it broke net_unittests?

bug: 822316

Original change's description:
> Fixed first_run test failure because of the global variables
> 
> Fixed typical problem with unit tests and global variables.
> If unit test modifies global variables then it can affect other tests
> which are runned in the same process. Added reseting of the global
> variables to avoid this.
> 
> Change-Id: I2045700473ac074209f4d48a6cedbd3dad24ccd5
> Reviewed-on: https://chromium-review.googlesource.com/952905
> Commit-Queue: Alexander Yashkin <a-v-y@yandex-team.ru>
> Reviewed-by: Carlos Pizano <cpu@chromium.org>
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#543345}

TBR=gab@chromium.org,cpu@chromium.org,a-v-y@yandex-team.ru,vitreb@yandex-team.ru

Change-Id: I616e5415b0e786dc5bd3075f1360b31a6452e256
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/964621Reviewed-by: default avatarCaleb Rouleau <crouleau@chromium.org>
Commit-Queue: Caleb Rouleau <crouleau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543423}
parent 4620e6d6
......@@ -84,10 +84,6 @@ bool g_should_do_autofill_personal_data_manager_first_run = false;
first_run::internal::FirstRunState g_first_run =
first_run::internal::FIRST_RUN_UNKNOWN;
// Cached first run sentinel creation time.
// Used to avoid excess file operations.
base::Time g_cached_sentinel_creation_time;
// This class acts as an observer for the ImporterProgressObserver::ImportEnded
// callback. When the import process is started, certain errors may cause
// ImportEnded() to be called synchronously, but the typical case is that
......@@ -453,14 +449,8 @@ void CreateSentinelIfNeeded() {
}
base::Time GetFirstRunSentinelCreationTime() {
if (g_cached_sentinel_creation_time.is_null())
g_cached_sentinel_creation_time = ReadFirstRunSentinelCreationTime();
return g_cached_sentinel_creation_time;
}
void ResetCachedSentinelDataForTesting() {
g_cached_sentinel_creation_time = base::Time();
g_first_run = first_run::internal::FIRST_RUN_UNKNOWN;
static const base::Time cached_time = ReadFirstRunSentinelCreationTime();
return cached_time;
}
void SetShouldShowWelcomePage() {
......
......@@ -104,10 +104,6 @@ void CreateSentinelIfNeeded();
// permission on the sequence it is first called on.
base::Time GetFirstRunSentinelCreationTime();
// Resets the first run status and cached first run sentinel creation time.
// This is needed for unit tests which are runned in the same process.
void ResetCachedSentinelDataForTesting();
// Sets a flag that will cause ShouldShowWelcomePage to return true
// exactly once, so that the browser loads the welcome tab once the
// message loop gets going.
......
......@@ -22,11 +22,6 @@ class FirstRunTest : public testing::Test {
FirstRunTest() : user_data_dir_override_(chrome::DIR_USER_DATA) {}
~FirstRunTest() override {}
void TearDown() override {
first_run::ResetCachedSentinelDataForTesting();
Test::TearDown();
}
private:
base::ScopedPathOverride user_data_dir_override_;
......
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