OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 package org.chromium.mojo.bindings; | 5 package org.chromium.mojo.bindings; |
6 | 6 |
| 7 import android.annotation.SuppressLint; |
7 import android.support.test.filters.SmallTest; | 8 import android.support.test.filters.SmallTest; |
8 | 9 |
9 import org.chromium.base.test.util.UrlUtils; | 10 import org.chromium.base.test.util.UrlUtils; |
10 import org.chromium.mojo.HandleMock; | 11 import org.chromium.mojo.HandleMock; |
11 import org.chromium.mojo.MojoTestCase; | 12 import org.chromium.mojo.MojoTestCase; |
12 import org.chromium.mojo.bindings.test.mojom.mojo.ConformanceTestInterface; | 13 import org.chromium.mojo.bindings.test.mojom.mojo.ConformanceTestInterface; |
13 import org.chromium.mojo.bindings.test.mojom.mojo.IntegrationTestInterface; | 14 import org.chromium.mojo.bindings.test.mojom.mojo.IntegrationTestInterface; |
14 import org.chromium.mojo.bindings.test.mojom.mojo.IntegrationTestInterfaceTestHe
lper; | 15 import org.chromium.mojo.bindings.test.mojom.mojo.IntegrationTestInterfaceTestHe
lper; |
15 import org.chromium.mojo.system.Handle; | 16 import org.chromium.mojo.system.Handle; |
16 import org.chromium.mojo.system.impl.CoreImpl; | 17 import org.chromium.mojo.system.impl.CoreImpl; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 public boolean accept(File pathname) { | 59 public boolean accept(File pathname) { |
59 // TODO(yzshen, qsr): skip some interface versioning tests. | 60 // TODO(yzshen, qsr): skip some interface versioning tests. |
60 if (pathname.getName().startsWith("conformance_mthd13_good_2")) { | 61 if (pathname.getName().startsWith("conformance_mthd13_good_2")) { |
61 return false; | 62 return false; |
62 } | 63 } |
63 return pathname.isFile() && pathname.getName().startsWith(mPrefix) | 64 return pathname.isFile() && pathname.getName().startsWith(mPrefix) |
64 && pathname.getName().endsWith(".data"); | 65 && pathname.getName().endsWith(".data"); |
65 } | 66 } |
66 } | 67 } |
67 | 68 |
| 69 @SuppressLint("NewApi") |
68 private static String getStringContent(File f) throws FileNotFoundException
{ | 70 private static String getStringContent(File f) throws FileNotFoundException
{ |
| 71 // TODO(crbug.com/635567): Fix this properly. |
69 try (Scanner scanner = new Scanner(f)) { | 72 try (Scanner scanner = new Scanner(f)) { |
70 scanner.useDelimiter("\\Z"); | 73 scanner.useDelimiter("\\Z"); |
71 StringBuilder result = new StringBuilder(); | 74 StringBuilder result = new StringBuilder(); |
72 while (scanner.hasNext()) { | 75 while (scanner.hasNext()) { |
73 result.append(scanner.next()); | 76 result.append(scanner.next()); |
74 } | 77 } |
75 return result.toString().trim(); | 78 return result.toString().trim(); |
76 } | 79 } |
77 } | 80 } |
78 | 81 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 @SmallTest | 231 @SmallTest |
229 public void testIntegrationResponseMessage() throws FileNotFoundException { | 232 public void testIntegrationResponseMessage() throws FileNotFoundException { |
230 runTest("integration_intf_resp_", | 233 runTest("integration_intf_resp_", |
231 new RoutingMessageReceiver(IntegrationTestInterface.MANAGER.buil
dStub(null, | 234 new RoutingMessageReceiver(IntegrationTestInterface.MANAGER.buil
dStub(null, |
232 IntegrationTestInterface.MANAGER.buildProxy(null, | 235 IntegrationTestInterface.MANAGER.buildProxy(null, |
233 new SinkMessageReceiver())), | 236 new SinkMessageReceiver())), |
234 IntegrationTestInterfaceTestHelper | 237 IntegrationTestInterfaceTestHelper |
235 .newIntegrationTestInterfaceMethodCallback())); | 238 .newIntegrationTestInterfaceMethodCallback())); |
236 } | 239 } |
237 } | 240 } |
OLD | NEW |