summaryrefslogtreecommitdiffstats
path: root/chrome/browser/first_run/first_run_unittest.cc
blob: 601416c95cdb602923a1ff5d8c00e35f7ae7952e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/file_util.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/first_run/first_run_internal.h"
#include "testing/gtest/include/gtest/gtest.h"

class FirstRunTest : public testing::Test {
 protected:
  virtual void SetUp() {
    first_run::internal::GetFirstRunSentinelFilePath(&sentinel_path_);
  }

  FilePath sentinel_path_;
};

TEST_F(FirstRunTest, RemoveSentinel) {
  EXPECT_TRUE(first_run::CreateSentinel());
  EXPECT_TRUE(file_util::PathExists(sentinel_path_));

  EXPECT_TRUE(first_run::RemoveSentinel());
  EXPECT_FALSE(file_util::PathExists(sentinel_path_));
}