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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/hwid_checker_unittest.cc
diff --git a/chrome/browser/chromeos/login/hwid_checker_unittest.cc b/chrome/browser/chromeos/login/hwid_checker_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d806a67870ed17123ecfdb6778264d8db9aab799
--- /dev/null
+++ b/chrome/browser/chromeos/login/hwid_checker_unittest.cc
@@ -0,0 +1,34 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/login/hwid_checker.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+
+namespace chromeos {
+
+TEST(HWIDCheckerTest, EmptyHWID) {
+ EXPECT_FALSE(IsHWIDCorrect(""));
+}
+
+TEST(HWIDCheckerTest, MalformedChecksum) {
+ EXPECT_TRUE(IsHWIDCorrect("SOME DATA 7861"));
+ EXPECT_FALSE(IsHWIDCorrect("SOME DATA 7861 "));
+ EXPECT_FALSE(IsHWIDCorrect("SOME DATA 786 1"));
+ EXPECT_FALSE(IsHWIDCorrect("SOME DATA 786"));
+ EXPECT_FALSE(IsHWIDCorrect("SOME DATA7861"));
+}
+
+TEST(HWIDCheckerTest, KnownHWIDs) {
+ EXPECT_TRUE(IsHWIDCorrect("DELL HORIZON MAGENTA 8992"));
+ EXPECT_FALSE(IsHWIDCorrect("DELL HORIZ0N MAGENTA 8992"));
+ EXPECT_TRUE(IsHWIDCorrect("DELL HORIZON MAGENTA DVT 4770"));
+ EXPECT_FALSE(IsHWIDCorrect("DELL MAGENTA HORIZON DVT 4770"));
+ EXPECT_TRUE(IsHWIDCorrect("SAMS ALEX GAMMA DVT 9247"));
+ EXPECT_FALSE(IsHWIDCorrect("SAMS ALPX GAMMA DVT 9247"));
+}
+
+} // namespace chromeos
+
« 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