blob: b40d359940f16b0546e099f99d4b41b5a2dee4d3 [file] [log] [blame]
/*
* Copyright (C) 2012 The Android Open Source Project
*
* 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 com.android.cts.verifier.p2p.testcase;
import java.util.ArrayList;
import java.util.List;
import com.android.cts.verifier.R;
import android.content.Context;
import android.net.wifi.p2p.nsd.WifiP2pDnsSdServiceRequest;
import android.net.wifi.p2p.nsd.WifiP2pServiceRequest;
import android.net.wifi.p2p.nsd.WifiP2pUpnpServiceRequest;
/**
* Service discovery requester test case to search all UPnP and Bonjour services with
* WifiP2pDnsSdServiceRequest.newInstance() and
* WifiP2pUpnpServiceRequest.newInstance().
*/
public class ServReqAllTestCase03 extends ServReqTestCase {
public ServReqAllTestCase03(Context context) {
super(context);
}
@Override
protected boolean executeTest() throws InterruptedException {
notifyTestMsg(R.string.p2p_checking_serv_capab);
/*
* create request to search all services.
*/
List<WifiP2pServiceRequest> reqList = new ArrayList<WifiP2pServiceRequest>();
reqList.add(WifiP2pDnsSdServiceRequest.newInstance());
reqList.add(WifiP2pUpnpServiceRequest.newInstance());
/*
* search and check the callback function.
*
* The expected the argument of the callback function is as follows.
* DNS PTR: ALL services.
* DNS TXT: ALL services.
* UPnP: ALL services.
*/
return searchTest(mTargetAddress, reqList,
DnsSdResponseListenerTest.ALL_DNS_PTR,
DnsSdTxtRecordListenerTest.ALL_DNS_TXT,
UPnPServiceResponseListenerTest.ALL_UPNP_SERVICES);
}
@Override
public String getTestName() {
return "Request all services test 03";
}
}