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/utf_string_conversions.h" | 7 #include "base/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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 ASSERT_EQ(PpapiHostMsg_PDF_GetLocalizedString::ID, | 52 ASSERT_EQ(PpapiHostMsg_PDF_GetLocalizedString::ID, |
53 handler.last_handled_msg().type()); | 53 handler.last_handled_msg().type()); |
54 ASSERT_EQ(expected_string, actual_string); | 54 ASSERT_EQ(expected_string, actual_string); |
55 } | 55 } |
56 | 56 |
57 // Remove the filter or it will be destroyed before the sink() is destroyed. | 57 // Remove the filter or it will be destroyed before the sink() is destroyed. |
58 sink().RemoveFilter(&handler); | 58 sink().RemoveFilter(&handler); |
59 } | 59 } |
60 | 60 |
61 TEST_F(PDFResourceTest, SearchString) { | 61 TEST_F(PDFResourceTest, SearchString) { |
| 62 ProxyAutoLock lock; |
62 // Instantiate a resource explicitly so we can specify the locale. | 63 // Instantiate a resource explicitly so we can specify the locale. |
63 scoped_refptr<PDFResource> pdf_resource( | 64 scoped_refptr<PDFResource> pdf_resource( |
64 new PDFResource(Connection(&sink(), &sink()), pp_instance())); | 65 new PDFResource(Connection(&sink(), &sink()), pp_instance())); |
65 pdf_resource->SetLocaleForTest("en-US"); | 66 pdf_resource->SetLocaleForTest("en-US"); |
66 | 67 |
67 string16 input; | 68 string16 input; |
68 string16 term; | 69 string16 term; |
69 UTF8ToUTF16("abcdefabcdef", 12, &input); | 70 UTF8ToUTF16("abcdefabcdef", 12, &input); |
70 UTF8ToUTF16("bc", 2, &term); | 71 UTF8ToUTF16("bc", 2, &term); |
71 | 72 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 200 |
200 resource_tracker->ReleaseResource(resource); | 201 resource_tracker->ReleaseResource(resource); |
201 } | 202 } |
202 | 203 |
203 // Remove the filter or it will be destroyed before the sink() is destroyed. | 204 // Remove the filter or it will be destroyed before the sink() is destroyed. |
204 sink().RemoveFilter(&handler); | 205 sink().RemoveFilter(&handler); |
205 } | 206 } |
206 | 207 |
207 } // namespace proxy | 208 } // namespace proxy |
208 } // namespace ppapi | 209 } // namespace ppapi |
OLD | NEW |