Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: utils_unittest.cc

Issue 6719012: Use crossystem rather than cros_boot_mode. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <sys/stat.h> 5 #include <sys/stat.h>
6 #include <sys/types.h> 6 #include <sys/types.h>
7 #include <errno.h> 7 #include <errno.h>
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 13 matching lines...) Expand all
24 24
25 class UtilsTest : public ::testing::Test { }; 25 class UtilsTest : public ::testing::Test { };
26 26
27 TEST(UtilsTest, IsOfficialBuild) { 27 TEST(UtilsTest, IsOfficialBuild) {
28 // Pretty lame test... 28 // Pretty lame test...
29 EXPECT_TRUE(utils::IsOfficialBuild()); 29 EXPECT_TRUE(utils::IsOfficialBuild());
30 } 30 }
31 31
32 TEST(UtilsTest, IsNormalBootMode) { 32 TEST(UtilsTest, IsNormalBootMode) {
33 // Pretty lame test... 33 // Pretty lame test...
34 EXPECT_FALSE(utils::IsNormalBootMode()); 34 EXPECT_TRUE(utils::IsNormalBootMode());
35 } 35 }
36 36
37 TEST(UtilsTest, NormalizePathTest) { 37 TEST(UtilsTest, NormalizePathTest) {
38 EXPECT_EQ("", utils::NormalizePath("", false)); 38 EXPECT_EQ("", utils::NormalizePath("", false));
39 EXPECT_EQ("", utils::NormalizePath("", true)); 39 EXPECT_EQ("", utils::NormalizePath("", true));
40 EXPECT_EQ("/", utils::NormalizePath("/", false)); 40 EXPECT_EQ("/", utils::NormalizePath("/", false));
41 EXPECT_EQ("", utils::NormalizePath("/", true)); 41 EXPECT_EQ("", utils::NormalizePath("/", true));
42 EXPECT_EQ("/", utils::NormalizePath("//", false)); 42 EXPECT_EQ("/", utils::NormalizePath("//", false));
43 EXPECT_EQ("", utils::NormalizePath("//", true)); 43 EXPECT_EQ("", utils::NormalizePath("//", true));
44 EXPECT_EQ("foo", utils::NormalizePath("foo", false)); 44 EXPECT_EQ("foo", utils::NormalizePath("foo", false));
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 // Not much to test. At least this tests for memory leaks, crashes, 272 // Not much to test. At least this tests for memory leaks, crashes,
273 // log errors. 273 // log errors.
274 GMainLoop* loop = g_main_loop_new(g_main_context_default(), FALSE); 274 GMainLoop* loop = g_main_loop_new(g_main_context_default(), FALSE);
275 utils::ScheduleCrashReporterUpload(); 275 utils::ScheduleCrashReporterUpload();
276 g_timeout_add_seconds(1, &TerminateScheduleCrashReporterUploadTest, loop); 276 g_timeout_add_seconds(1, &TerminateScheduleCrashReporterUploadTest, loop);
277 g_main_loop_run(loop); 277 g_main_loop_run(loop);
278 g_main_loop_unref(loop); 278 g_main_loop_unref(loop);
279 } 279 }
280 280
281 } // namespace chromeos_update_engine 281 } // namespace chromeos_update_engine
OLDNEW
« no previous file with comments | « utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698