Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Improve crypto test: create a helper. Also improve callbacks.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarty committed Nov 29, 2018
1 parent 497c7fa commit 27ba2a9
Show file tree
Hide file tree
Showing 21 changed files with 876 additions and 947 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ private MXSession createAccountAndSync(Context context,
CountDownLatch lock = new CountDownLatch(1);

// get the registration session id
loginRestClient.register(registrationParams, new TestApiCallback<Credentials>(lock) {
loginRestClient.register(registrationParams, new TestApiCallback<Credentials>(lock, false) {
@Override
public void onMatrixError(MatrixError e) {
// detect if a parameter is expected
Expand Down Expand Up @@ -356,7 +356,7 @@ public void onSuccess(Credentials credentials) {
* @throws InterruptedException
*/
public void await(CountDownLatch latch) throws InterruptedException {
Assert.assertTrue(latch.await(TestConstants.AWAIT_TIME_OUT_MILLIS, TimeUnit.MILLISECONDS));
Assert.assertTrue(latch.await(TestConstants.getTimeOutMillis(), TimeUnit.MILLISECONDS));
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright 2018 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.matrix.androidsdk.common

import android.content.Context
import org.matrix.androidsdk.MXSession

data class CryptoTestData(val firstSession: MXSession,
val roomId: String,
val secondSession: MXSession? = null,
val thirdSession: MXSession? = null) {

fun clear(context: Context) {
firstSession.clear(context)
secondSession?.clear(context)
secondSession?.clear(context)
}
}

0 comments on commit 27ba2a9

Please sign in to comment.