Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / platform / UUIDTest.cpp
blobb926b697b3d70d1c741b6551dcdb2b35badc2582
1 // Copyright 2015 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 "config.h"
6 #include "platform/UUID.h"
8 #include <gtest/gtest.h>
10 namespace blink {
12 TEST(UUIDTest, BaseUUID)
14 EXPECT_TRUE(isValidUUID("00000000-0000-0000-0000-000000000000"));
17 TEST(UUIDTest, ComplexUUID)
19 EXPECT_TRUE(isValidUUID("01234567-89ab-cdef-0123-456789abcdef"));
20 EXPECT_TRUE(isValidUUID("7ad025e0-1e86-11e5-b5f7-727283247c7f"));
23 TEST(UUIDTest, WrongCharacter)
25 EXPECT_FALSE(isValidUUID("g0000000-0000-0000-0000-000000000000"));
26 EXPECT_FALSE(isValidUUID("0000000g-0000-0000-0000-000000000000"));
27 EXPECT_FALSE(isValidUUID("00000000-g000-0000-0000-000000000000"));
28 EXPECT_FALSE(isValidUUID("00000000-000g-0000-0000-000000000000"));
29 EXPECT_FALSE(isValidUUID("00000000-0000-g000-0000-000000000000"));
30 EXPECT_FALSE(isValidUUID("00000000-0000-000g-0000-000000000000"));
31 EXPECT_FALSE(isValidUUID("00000000-0000-0000-g000-000000000000"));
32 EXPECT_FALSE(isValidUUID("00000000-0000-0000-000g-000000000000"));
33 EXPECT_FALSE(isValidUUID("00000000-0000-0000-0000-g00000000000"));
34 EXPECT_FALSE(isValidUUID("00000000-0000-0000-0000-00000000000g"));
37 TEST(UUIDTest, UpperCaseCharacter)
39 EXPECT_FALSE(isValidUUID("A0000000-0000-0000-0000-000000000000"));
40 EXPECT_FALSE(isValidUUID("0000000A-0000-0000-0000-000000000000"));
41 EXPECT_FALSE(isValidUUID("00000000-A000-0000-0000-000000000000"));
42 EXPECT_FALSE(isValidUUID("00000000-000A-0000-0000-000000000000"));
43 EXPECT_FALSE(isValidUUID("00000000-0000-A000-0000-000000000000"));
44 EXPECT_FALSE(isValidUUID("00000000-0000-000A-0000-000000000000"));
45 EXPECT_FALSE(isValidUUID("00000000-0000-0000-A000-000000000000"));
46 EXPECT_FALSE(isValidUUID("00000000-0000-0000-000A-000000000000"));
47 EXPECT_FALSE(isValidUUID("00000000-0000-0000-0000-A00000000000"));
48 EXPECT_FALSE(isValidUUID("00000000-0000-0000-0000-00000000000A"));
51 TEST(UUIDTest, LongUUID)
53 EXPECT_FALSE(isValidUUID("a00000000-0000-0000-0000-000000000000"));
54 EXPECT_FALSE(isValidUUID("00000000a-0000-0000-0000-000000000000"));
55 EXPECT_FALSE(isValidUUID("00000000-a0000-0000-0000-000000000000"));
56 EXPECT_FALSE(isValidUUID("00000000-0000a-0000-0000-000000000000"));
57 EXPECT_FALSE(isValidUUID("00000000-0000-a0000-0000-000000000000"));
58 EXPECT_FALSE(isValidUUID("00000000-0000-0000a-0000-000000000000"));
59 EXPECT_FALSE(isValidUUID("00000000-0000-0000-a0000-000000000000"));
60 EXPECT_FALSE(isValidUUID("00000000-0000-0000-0000a-000000000000"));
61 EXPECT_FALSE(isValidUUID("00000000-0000-0000-0000-a000000000000"));
62 EXPECT_FALSE(isValidUUID("00000000-0000-0000-0000-000000000000a"));
65 TEST(UUIDTest, ShortUUID)
67 EXPECT_FALSE(isValidUUID("0000000-0000-0000-0000-000000000000"));
68 EXPECT_FALSE(isValidUUID("0000000-0000-0000-0000-000000000000"));
69 EXPECT_FALSE(isValidUUID("00000000-000-0000-0000-000000000000"));
70 EXPECT_FALSE(isValidUUID("00000000-000-0000-0000-000000000000"));
71 EXPECT_FALSE(isValidUUID("00000000-0000-000-0000-000000000000"));
72 EXPECT_FALSE(isValidUUID("00000000-0000-000-0000-000000000000"));
73 EXPECT_FALSE(isValidUUID("00000000-0000-0000-000-000000000000"));
74 EXPECT_FALSE(isValidUUID("00000000-0000-0000-000-000000000000"));
75 EXPECT_FALSE(isValidUUID("00000000-0000-0000-0000-00000000000"));
76 EXPECT_FALSE(isValidUUID("00000000-0000-0000-0000-00000000000"));
79 TEST(UUIDTest, NoHyphen)
81 EXPECT_FALSE(isValidUUID("00000000 0000 0000 0000 000000000000"));
84 } // namespace blink