blob: 6a0ecae6697704f8c91ab5a057a92a49aaa0acdd [file] [log] [blame]
Greg Thompson85bd488c2017-06-08 09:18:111// Copyright 2017 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "chrome/browser/active_use_util.h"
6
7#include "base/command_line.h"
8#include "base/files/file_path.h"
9#include "build/build_config.h"
10#include "chrome/common/chrome_switches.h"
11#include "testing/gtest/include/gtest/gtest.h"
12
13TEST(ShouldRecordActiveUse, OrdinaryCommand) {
14 base::CommandLine cmd_line(base::FilePath(FILE_PATH_LITERAL("foo.exe")));
15#if !defined(OS_WIN) || defined(GOOGLE_CHROME_BUILD)
16 EXPECT_TRUE(ShouldRecordActiveUse(cmd_line));
17#else
18 EXPECT_FALSE(ShouldRecordActiveUse(cmd_line));
19#endif
20}
21
22TEST(ShouldRecordActiveUse, TryChromeAgainCommand) {
23 base::CommandLine cmd_line(base::FilePath(FILE_PATH_LITERAL("foo.exe")));
24 cmd_line.AppendSwitchASCII(switches::kTryChromeAgain, "0");
25
26 EXPECT_FALSE(ShouldRecordActiveUse(cmd_line));
27}