Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / remoting / host / setup / pin_validator_unittest.cc
blob9b161119592ed408f3502deac8a9b2112f79254a
1 // Copyright (c) 2012 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.
5 #include "remoting/host/setup/pin_validator.h"
7 #include "testing/gtest/include/gtest/gtest.h"
9 namespace remoting {
11 TEST(IsPinValidTest, Normal) {
12 EXPECT_TRUE(IsPinValid("123456"));
15 TEST(IsPinValidTest, Short) {
16 EXPECT_FALSE(IsPinValid("12345"));
19 TEST(IsPinValidTest, Long) {
20 EXPECT_TRUE(IsPinValid("1234567"));
23 TEST(IsPinValidTest, BadCharacter) {
24 EXPECT_FALSE(IsPinValid("12345/"));
25 EXPECT_FALSE(IsPinValid("123456/"));
26 EXPECT_FALSE(IsPinValid("/123456"));
27 EXPECT_FALSE(IsPinValid("12345:"));
28 EXPECT_FALSE(IsPinValid("123456:"));
29 EXPECT_FALSE(IsPinValid(":123456"));
30 EXPECT_FALSE(IsPinValid("12345a"));
31 EXPECT_FALSE(IsPinValid("123456a"));
32 EXPECT_FALSE(IsPinValid("a123456"));
35 } // namespace remoting