Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: mojo/android/javatests/src/org/chromium/mojo/bindings/BindingsTestUtils.java

Issue 522353003: mojo: Run validation tests on java (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move backward compatibility test o its own package. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 org.chromium.mojo.TestUtils; 7 import org.chromium.mojo.TestUtils;
8 import org.chromium.mojo.system.Handle; 8 import org.chromium.mojo.system.Handle;
9 import org.chromium.mojo.system.MojoException; 9 import org.chromium.mojo.system.MojoException;
10 import org.chromium.mojo.system.Pair; 10 import org.chromium.mojo.system.Pair;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 /** 73 /**
74 * Returns the last recorded exception. 74 * Returns the last recorded exception.
75 */ 75 */
76 public MojoException getLastMojoException() { 76 public MojoException getLastMojoException() {
77 return mLastMojoException; 77 return mLastMojoException;
78 } 78 }
79 79
80 } 80 }
81 81
82 /** 82 /**
83 * Creates a new valid {@link MessageWithHeader}. 83 * Creates a new valid {@link Message}. The message will have a valid header .
84 */ 84 */
85 public static MessageWithHeader newRandomMessageWithHeader(int size) { 85 public static Message newRandomMessageWithHeader(int size) {
86 assert size > 16; 86 assert size > 16;
87 ByteBuffer message = TestUtils.newRandomBuffer(size); 87 ByteBuffer message = TestUtils.newRandomBuffer(size);
88 int[] headerAsInts = { 16, 2, 0, 0 }; 88 int[] headerAsInts = { 16, 2, 0, 0 };
89 for (int i = 0; i < 4; ++i) { 89 for (int i = 0; i < 4; ++i) {
90 message.putInt(4 * i, headerAsInts[i]); 90 message.putInt(4 * i, headerAsInts[i]);
91 } 91 }
92 message.position(0); 92 message.position(0);
93 return new SimpleMessage(message, new ArrayList<Handle>()).asMojoMessage (); 93 return new SimpleMessage(message, new ArrayList<Handle>());
94 } 94 }
95 } 95 }
OLDNEW
« no previous file with comments | « mojo/android/javatests/AndroidManifest.xml ('k') | mojo/android/javatests/src/org/chromium/mojo/bindings/ValidationTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698