| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/xml/XPathFunctions.h" | 5 #include "core/xml/XPathFunctions.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/xml/XPathExpressionNode.h" // EvaluationContext | 8 #include "core/xml/XPathExpressionNode.h" // EvaluationContext |
| 9 #include "core/xml/XPathPredicate.h" // Number, StringExpression | 9 #include "core/xml/XPathPredicate.h" // Number, StringExpression |
| 10 #include "core/xml/XPathValue.h" | 10 #include "core/xml/XPathValue.h" |
| 11 #include "platform/heap/Handle.h" // HeapVector, Member, etc. | 11 #include "platform/heap/Handle.h" // HeapVector, Member, etc. |
| 12 #include "platform/wtf/Allocator.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "wtf/Allocator.h" | |
| 14 | 14 |
| 15 #include <cmath> | 15 #include <cmath> |
| 16 #include <limits> | 16 #include <limits> |
| 17 | 17 |
| 18 namespace blink { | 18 namespace blink { |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 class XPathContext { | 22 class XPathContext { |
| 23 STACK_ALLOCATED(); | 23 STACK_ALLOCATED(); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 TEST(XPathFunctionsTest, substring_extremePositionLength) { | 117 TEST(XPathFunctionsTest, substring_extremePositionLength) { |
| 118 EXPECT_EQ("", Substring("no way", 1e100, 7.0)) | 118 EXPECT_EQ("", Substring("no way", 1e100, 7.0)) |
| 119 << "extremely large positions should result in the empty string"; | 119 << "extremely large positions should result in the empty string"; |
| 120 | 120 |
| 121 EXPECT_EQ("no way", Substring("no way", -1e200, 1e300)) | 121 EXPECT_EQ("no way", Substring("no way", -1e200, 1e300)) |
| 122 << "although these indices are not representable as long, this should " | 122 << "although these indices are not representable as long, this should " |
| 123 << "produce the string because indices are computed as doubles"; | 123 << "produce the string because indices are computed as doubles"; |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace blink | 126 } // namespace blink |
| OLD | NEW |