[M85 Dev][EFL] Fix errors to generate ninja files
[platform/framework/web/chromium-efl.git] / chrome / browser / active_use_util_unittest.cc
1 // 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/branding_buildflags.h"
10 #include "build/build_config.h"
11 #include "chrome/common/chrome_switches.h"
12 #include "testing/gtest/include/gtest/gtest.h"
13
14 TEST(ShouldRecordActiveUse, OrdinaryCommand) {
15   base::CommandLine cmd_line(base::FilePath(FILE_PATH_LITERAL("foo.exe")));
16 #if !defined(OS_WIN) || BUILDFLAG(GOOGLE_CHROME_BRANDING)
17   EXPECT_TRUE(ShouldRecordActiveUse(cmd_line));
18 #else
19   EXPECT_FALSE(ShouldRecordActiveUse(cmd_line));
20 #endif
21 }
22
23 // --try-chrome-again by itself shouldn't do anything, just like the
24 // OrdinaryCommand case.
25 TEST(ShouldRecordActiveUse, FakeTryChromeAgainCommand) {
26   base::CommandLine cmd_line(base::FilePath(FILE_PATH_LITERAL("foo.exe")));
27   cmd_line.AppendSwitch(switches::kTryChromeAgain);
28 #if !defined(OS_WIN) || BUILDFLAG(GOOGLE_CHROME_BRANDING)
29   EXPECT_TRUE(ShouldRecordActiveUse(cmd_line));
30 #else
31   EXPECT_FALSE(ShouldRecordActiveUse(cmd_line));
32 #endif
33 }
34
35 TEST(ShouldRecordActiveUse, TryChromeAgainCommand) {
36   base::CommandLine cmd_line(base::FilePath(FILE_PATH_LITERAL("foo.exe")));
37   cmd_line.AppendSwitchASCII(switches::kTryChromeAgain, "0");
38
39   EXPECT_FALSE(ShouldRecordActiveUse(cmd_line));
40 }