OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <cstring> | 5 #include <cstring> |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "ppapi/c/dev/ppb_memory_dev.h" | 8 #include "ppapi/c/dev/ppb_memory_dev.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/c/ppb_image_data.h" | 10 #include "ppapi/c/ppb_image_data.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 TEST_F(PDFResourceTest, SearchString) { | 61 TEST_F(PDFResourceTest, SearchString) { |
62 ProxyAutoLock lock; | 62 ProxyAutoLock lock; |
63 // Instantiate a resource explicitly so we can specify the locale. | 63 // Instantiate a resource explicitly so we can specify the locale. |
64 scoped_refptr<PDFResource> pdf_resource( | 64 scoped_refptr<PDFResource> pdf_resource( |
65 new PDFResource(Connection(&sink(), &sink()), pp_instance())); | 65 new PDFResource(Connection(&sink(), &sink()), pp_instance())); |
66 pdf_resource->SetLocaleForTest("en-US"); | 66 pdf_resource->SetLocaleForTest("en-US"); |
67 | 67 |
68 base::string16 input; | 68 base::string16 input; |
69 base::string16 term; | 69 base::string16 term; |
70 UTF8ToUTF16("abcdefabcdef", 12, &input); | 70 base::UTF8ToUTF16("abcdefabcdef", 12, &input); |
71 UTF8ToUTF16("bc", 2, &term); | 71 base::UTF8ToUTF16("bc", 2, &term); |
72 | 72 |
73 PP_PrivateFindResult* results; | 73 PP_PrivateFindResult* results; |
74 int count = 0; | 74 int count = 0; |
75 pdf_resource->SearchString( | 75 pdf_resource->SearchString( |
76 reinterpret_cast<const unsigned short*>(input.c_str()), | 76 reinterpret_cast<const unsigned short*>(input.c_str()), |
77 reinterpret_cast<const unsigned short*>(term.c_str()), | 77 reinterpret_cast<const unsigned short*>(term.c_str()), |
78 true, | 78 true, |
79 &results, | 79 &results, |
80 &count); | 80 &count); |
81 | 81 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 resource_tracker->ReleaseResource(resource); | 198 resource_tracker->ReleaseResource(resource); |
199 } | 199 } |
200 | 200 |
201 // Remove the filter or it will be destroyed before the sink() is destroyed. | 201 // Remove the filter or it will be destroyed before the sink() is destroyed. |
202 sink().RemoveFilter(&handler); | 202 sink().RemoveFilter(&handler); |
203 } | 203 } |
204 | 204 |
205 } // namespace proxy | 205 } // namespace proxy |
206 } // namespace ppapi | 206 } // namespace ppapi |
OLD | NEW |