| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 TEST(IDBKeyPathTest, ValidKeyPath0) { | 55 TEST(IDBKeyPathTest, ValidKeyPath0) { |
| 56 Vector<String> expected; | 56 Vector<String> expected; |
| 57 String keyPath(""); | 57 String keyPath(""); |
| 58 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorNone); | 58 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorNone); |
| 59 } | 59 } |
| 60 | 60 |
| 61 TEST(IDBKeyPathTest, ValidKeyPath1) { | 61 TEST(IDBKeyPathTest, ValidKeyPath1) { |
| 62 Vector<String> expected; | 62 Vector<String> expected; |
| 63 String keyPath("foo"); | 63 String keyPath("foo"); |
| 64 expected.append(String("foo")); | 64 expected.push_back(String("foo")); |
| 65 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorNone); | 65 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorNone); |
| 66 } | 66 } |
| 67 | 67 |
| 68 TEST(IDBKeyPathTest, ValidKeyPath2) { | 68 TEST(IDBKeyPathTest, ValidKeyPath2) { |
| 69 Vector<String> expected; | 69 Vector<String> expected; |
| 70 String keyPath("foo.bar.baz"); | 70 String keyPath("foo.bar.baz"); |
| 71 expected.append(String("foo")); | 71 expected.push_back(String("foo")); |
| 72 expected.append(String("bar")); | 72 expected.push_back(String("bar")); |
| 73 expected.append(String("baz")); | 73 expected.push_back(String("baz")); |
| 74 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorNone); | 74 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorNone); |
| 75 } | 75 } |
| 76 | 76 |
| 77 TEST(IDBKeyPathTest, InvalidKeyPath0) { | 77 TEST(IDBKeyPathTest, InvalidKeyPath0) { |
| 78 Vector<String> expected; | 78 Vector<String> expected; |
| 79 String keyPath(" "); | 79 String keyPath(" "); |
| 80 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorIdentifier); | 80 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorIdentifier); |
| 81 } | 81 } |
| 82 | 82 |
| 83 TEST(IDBKeyPathTest, InvalidKeyPath1) { | 83 TEST(IDBKeyPathTest, InvalidKeyPath1) { |
| 84 Vector<String> expected; | 84 Vector<String> expected; |
| 85 String keyPath("+foo.bar.baz"); | 85 String keyPath("+foo.bar.baz"); |
| 86 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorIdentifier); | 86 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorIdentifier); |
| 87 } | 87 } |
| 88 | 88 |
| 89 TEST(IDBKeyPathTest, InvalidKeyPath2) { | 89 TEST(IDBKeyPathTest, InvalidKeyPath2) { |
| 90 Vector<String> expected; | 90 Vector<String> expected; |
| 91 String keyPath("foo bar baz"); | 91 String keyPath("foo bar baz"); |
| 92 expected.append(String("foo")); | 92 expected.push_back(String("foo")); |
| 93 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorIdentifier); | 93 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorIdentifier); |
| 94 } | 94 } |
| 95 | 95 |
| 96 TEST(IDBKeyPathTest, InvalidKeyPath3) { | 96 TEST(IDBKeyPathTest, InvalidKeyPath3) { |
| 97 Vector<String> expected; | 97 Vector<String> expected; |
| 98 String keyPath("foo .bar .baz"); | 98 String keyPath("foo .bar .baz"); |
| 99 expected.append(String("foo")); | 99 expected.push_back(String("foo")); |
| 100 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorIdentifier); | 100 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorIdentifier); |
| 101 } | 101 } |
| 102 | 102 |
| 103 TEST(IDBKeyPathTest, InvalidKeyPath4) { | 103 TEST(IDBKeyPathTest, InvalidKeyPath4) { |
| 104 Vector<String> expected; | 104 Vector<String> expected; |
| 105 String keyPath("foo. bar. baz"); | 105 String keyPath("foo. bar. baz"); |
| 106 expected.append(String("foo")); | 106 expected.push_back(String("foo")); |
| 107 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorIdentifier); | 107 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorIdentifier); |
| 108 } | 108 } |
| 109 | 109 |
| 110 TEST(IDBKeyPathTest, InvalidKeyPath5) { | 110 TEST(IDBKeyPathTest, InvalidKeyPath5) { |
| 111 Vector<String> expected; | 111 Vector<String> expected; |
| 112 String keyPath("foo..bar..baz"); | 112 String keyPath("foo..bar..baz"); |
| 113 expected.append(String("foo")); | 113 expected.push_back(String("foo")); |
| 114 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorIdentifier); | 114 checkKeyPath(keyPath, expected, IDBKeyPathParseErrorIdentifier); |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace | 117 } // namespace |
| 118 } // namespace blink | 118 } // namespace blink |
| OLD | NEW |