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

Side by Side Diff: chrome/browser/chromeos/login/hwid_checker_unittest.cc

Issue 12213110: Implemented screen notifying users about malformed HWID. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Implemented wizard controller test. Created 7 years, 10 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
OLDNEW
(Empty)
1 // Copyright (c) 2013 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/chromeos/login/hwid_checker.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9
10 namespace chromeos {
11
12 TEST(HWIDCheckerTest, EmptyHWID) {
13 EXPECT_FALSE(IsHWIDCorrect(""));
14 }
15
16 TEST(HWIDCheckerTest, MalformedChecksum) {
17 EXPECT_TRUE(IsHWIDCorrect("SOME DATA 7861"));
18 EXPECT_FALSE(IsHWIDCorrect("SOME DATA 7861 "));
19 EXPECT_FALSE(IsHWIDCorrect("SOME DATA 786 1"));
20 EXPECT_FALSE(IsHWIDCorrect("SOME DATA 786"));
21 EXPECT_FALSE(IsHWIDCorrect("SOME DATA7861"));
22 }
23
24 TEST(HWIDCheckerTest, KnownHWIDs) {
25 EXPECT_TRUE(IsHWIDCorrect("DELL HORIZON MAGENTA 8992"));
26 EXPECT_FALSE(IsHWIDCorrect("DELL HORIZ0N MAGENTA 8992"));
27 EXPECT_TRUE(IsHWIDCorrect("DELL HORIZON MAGENTA DVT 4770"));
28 EXPECT_FALSE(IsHWIDCorrect("DELL MAGENTA HORIZON DVT 4770"));
29 EXPECT_TRUE(IsHWIDCorrect("SAMS ALEX GAMMA DVT 9247"));
30 EXPECT_FALSE(IsHWIDCorrect("SAMS ALPX GAMMA DVT 9247"));
31 }
32
33 } // namespace chromeos
34
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/hwid_checker.cc ('k') | chrome/browser/chromeos/login/login_display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698