1 /* 2 * Copyright (C) 2012 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.cts.monkey; 18 19 public class VerbosityTest extends AbstractMonkeyTest { 20 21 public void testVerbosity() throws Exception { 22 String v0 = mDevice.executeShellCommand(MONKEY_CMD + " -s 1337 -p " + PKGS[0] + " 500"); 23 assertTrue(v0.contains("Events injected")); 24 assertFalse(v0.contains("Sending Touch")); 25 assertFalse(v0.contains("Sending Trackball")); 26 assertFalse(v0.contains("Switch")); 27 assertFalse(v0.contains("Sleeping")); 28 29 String v1 = mDevice.executeShellCommand(MONKEY_CMD + " -v -p " + PKGS[0] + " 500"); 30 assertTrue(v1.contains("Events injected")); 31 assertTrue(v1.contains("Sending Touch")); 32 assertTrue(v1.contains("Sending Trackball")); 33 assertTrue(v1.contains("Switch")); 34 assertFalse(v1.contains("Sleeping")); 35 36 String v2 = mDevice.executeShellCommand(MONKEY_CMD + " -v -v -p " + PKGS[0] + " 500"); 37 assertTrue(v2.contains("Events injected")); 38 assertTrue(v2.contains("Sending Touch")); 39 assertTrue(v2.contains("Sending Trackball")); 40 assertTrue(v2.contains("Switch")); 41 assertTrue(v2.contains("Sleeping")); 42 43 assertTrue(v0.length() < v1.length()); 44 assertTrue(v1.length() < v2.length()); 45 } 46 } 47