• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2018 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.tests.sysmem.device;
18 
19 import android.app.Activity;
20 import android.app.Instrumentation;
21 import android.os.Bundle;
22 import android.util.Log;
23 
24 /**
25  * Critical user journeys used to exercise the system for test, driven from
26  * the device.
27  */
28 public class Cujs extends Instrumentation {
29 
30     private static final String TAG = "SystemMemoryTest";
31 
32     @Override
onCreate(Bundle arguments)33     public void onCreate(Bundle arguments) {
34         start();
35     }
36 
37     @Override
onStart()38     public void onStart() {
39         // TODO: Exercise the system in more interesting ways.
40         // Mostly what matters is that whatever we do here is sustainable: it
41         // can be repeated indefinitely on the system without causing
42         // problems.  For example, launching activities is fine. Installing
43         // applications is only fine if we also uninstall them as part of the
44         // test.
45         try {
46             Log.i(TAG, "Sleeping for 10 seconds...");
47             Thread.sleep(10 * 1000);
48         } catch (InterruptedException ignored) {
49         }
50 
51         finish(Activity.RESULT_OK, null);
52     }
53 }
54