| 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 <ostream> |
| 5 #include "platform/network/ResourceError.h" | 6 #include "platform/network/ResourceError.h" |
| 6 #include <ostream> | |
| 7 | 7 |
| 8 // Pretty printer for gtest. | 8 // Pretty printer for gtest. |
| 9 // Each corresponding declaration should be placed in the header file of | 9 // Each corresponding declaration should be placed in the header file of |
| 10 // the corresponding class (e.g. ResourceError.h) to avoid ODR violations, | 10 // the corresponding class (e.g. ResourceError.h) to avoid ODR violations, |
| 11 // not in e.g. PlatformTestPrinters.h. See https://crbug.com/514330. | 11 // not in e.g. PlatformTestPrinters.h. See https://crbug.com/514330. |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 std::ostream& operator<<(std::ostream& os, const ResourceError& error) { | 15 std::ostream& operator<<(std::ostream& os, const ResourceError& error) { |
| 16 return os << "domain = " << error.domain() | 16 return os << "domain = " << error.domain() |
| 17 << ", errorCode = " << error.errorCode() | 17 << ", errorCode = " << error.errorCode() |
| 18 << ", failingURL = " << error.failingURL() | 18 << ", failingURL = " << error.failingURL() |
| 19 << ", localizedDescription = " << error.localizedDescription() | 19 << ", localizedDescription = " << error.localizedDescription() |
| 20 << ", isNull = " << error.isNull() | 20 << ", isNull = " << error.isNull() |
| 21 << ", isCancellation = " << error.isCancellation() | 21 << ", isCancellation = " << error.isCancellation() |
| 22 << ", isAccessCheck = " << error.isAccessCheck() | 22 << ", isAccessCheck = " << error.isAccessCheck() |
| 23 << ", isTimeout = " << error.isTimeout() | 23 << ", isTimeout = " << error.isTimeout() |
| 24 << ", staleCopyInCache = " << error.staleCopyInCache() | 24 << ", staleCopyInCache = " << error.staleCopyInCache() |
| 25 << ", wasIgnoredByHandler = " << error.wasIgnoredByHandler() | 25 << ", wasIgnoredByHandler = " << error.wasIgnoredByHandler() |
| 26 << ", isCacheMiss = " << error.isCacheMiss(); | 26 << ", isCacheMiss = " << error.isCacheMiss(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 } // namespace blink | 29 } // namespace blink |
| OLD | NEW |