OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/file_path.h" | 5 #include "base/file_path.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "chrome/renderer/translate/page_translator.h" | 8 #include "chrome/renderer/translate/page_translator.h" |
9 #include "chrome/test/render_view_test.h" | 9 #include "chrome/test/render_view_test.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 DISALLOW_COPY_AND_ASSIGN(ReverseTextTranslator); | 67 DISALLOW_COPY_AND_ASSIGN(ReverseTextTranslator); |
68 }; | 68 }; |
69 | 69 |
70 // A simple ResourceLoaderBridge that always fails to load. | 70 // A simple ResourceLoaderBridge that always fails to load. |
71 class DummyResourceLoaderBridge : public webkit_glue::ResourceLoaderBridge { | 71 class DummyResourceLoaderBridge : public webkit_glue::ResourceLoaderBridge { |
72 public: | 72 public: |
73 DummyResourceLoaderBridge() { } | 73 DummyResourceLoaderBridge() { } |
74 | 74 |
75 virtual void AppendDataToUpload(const char* data, int data_len) {} | 75 virtual void AppendDataToUpload(const char* data, int data_len) {} |
76 virtual void AppendFileRangeToUpload(const FilePath& file_path, | 76 virtual void AppendFileRangeToUpload( |
77 uint64 offset, uint64 length) {} | 77 const FilePath& file_path, |
| 78 uint64 offset, |
| 79 uint64 length, |
| 80 const base::Time& expected_modification_time) {} |
78 virtual void SetUploadIdentifier(int64 identifier) {} | 81 virtual void SetUploadIdentifier(int64 identifier) {} |
79 virtual bool Start(Peer* peer) { return false; } | 82 virtual bool Start(Peer* peer) { return false; } |
80 virtual void Cancel() {} | 83 virtual void Cancel() {} |
81 virtual void SetDefersLoading(bool value) {} | 84 virtual void SetDefersLoading(bool value) {} |
82 virtual void SyncLoad(SyncLoadResponse* response) { | 85 virtual void SyncLoad(SyncLoadResponse* response) { |
83 response->status.set_status(URLRequestStatus::FAILED); | 86 response->status.set_status(URLRequestStatus::FAILED); |
84 response->status.set_os_error(net::ERR_FAILED); | 87 response->status.set_os_error(net::ERR_FAILED); |
85 } | 88 } |
86 | 89 |
87 private: | 90 private: |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 string16 expected(expected_translated_contents.data() + index, len); | 206 string16 expected(expected_translated_contents.data() + index, len); |
204 string16 actual(actual_translated_contents.data() + index, len); | 207 string16 actual(actual_translated_contents.data() + index, len); |
205 ASSERT_EQ(expected, actual); | 208 ASSERT_EQ(expected, actual); |
206 index += 80; | 209 index += 80; |
207 } | 210 } |
208 | 211 |
209 // Iterate to the next file to test. | 212 // Iterate to the next file to test. |
210 original_file_path = file_enumerator.Next(); | 213 original_file_path = file_enumerator.Next(); |
211 } | 214 } |
212 } | 215 } |
OLD | NEW |