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

Side by Side Diff: bootloader_type_unittest.cc

Issue 3601014: cros_boot_mode: make cros_debug bootloader argument prempt others (Closed) Base URL: http://git.chromium.org/git/cros_boot_mode.git
Patch Set: Created 10 years, 2 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 | « bootloader_type.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 // Tests for cros_boot_mode::BootloaderType default behavior. 5 // Tests for cros_boot_mode::BootloaderType default behavior.
6 #include "bootloader_type.h" 6 #include "bootloader_type.h"
7 7
8 #include <base/basictypes.h> 8 #include <base/basictypes.h>
9 #include <base/file_util.h> 9 #include <base/file_util.h>
10 #include <base/stringprintf.h> 10 #include <base/stringprintf.h>
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 cros_boot_mode::BootloaderType::kSupportedBootloaders[ 92 cros_boot_mode::BootloaderType::kSupportedBootloaders[
93 cros_boot_mode::BootloaderType::kChromeOS]); 93 cros_boot_mode::BootloaderType::kChromeOS]);
94 94
95 EXPECT_EQ(file_util::WriteFile(FilePath(type_file_path_), 95 EXPECT_EQ(file_util::WriteFile(FilePath(type_file_path_),
96 contents.c_str(), contents.length()), 96 contents.c_str(), contents.length()),
97 contents.length()); 97 contents.length());
98 type_.Initialize(); 98 type_.Initialize();
99 ExpectType(cros_boot_mode::BootloaderType::kUnsupported); 99 ExpectType(cros_boot_mode::BootloaderType::kUnsupported);
100 } 100 }
101 101
102 TEST_F(BootloaderTypeTest, FirstMatchIsUsed) { 102 TEST_F(BootloaderTypeTest, FirstMatchInEnumOrderIsUsed) {
103 std::string contents = StringPrintf(" %s %s ", 103 std::string contents = StringPrintf(" %s %s ",
104 cros_boot_mode::BootloaderType::kSupportedBootloaders[ 104 cros_boot_mode::BootloaderType::kSupportedBootloaders[
105 cros_boot_mode::BootloaderType::kChromeOS], 105 cros_boot_mode::BootloaderType::kChromeOS],
106 cros_boot_mode::BootloaderType::kSupportedBootloaders[ 106 cros_boot_mode::BootloaderType::kSupportedBootloaders[
107 cros_boot_mode::BootloaderType::kEFI]); 107 cros_boot_mode::BootloaderType::kDebug]);
108 108
109 EXPECT_EQ(file_util::WriteFile(FilePath(type_file_path_), 109 EXPECT_EQ(file_util::WriteFile(FilePath(type_file_path_),
110 contents.c_str(), contents.length()), 110 contents.c_str(), contents.length()),
111 contents.length()); 111 contents.length());
112 type_.Initialize(); 112 type_.Initialize();
113 ExpectType(cros_boot_mode::BootloaderType::kChromeOS); 113 ExpectType(cros_boot_mode::BootloaderType::kDebug);
114 } 114 }
115
OLDNEW
« no previous file with comments | « bootloader_type.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698