| Index: clank/test/geppetto/clanktests/src/com/google/android/apps/chrome/uiautomator/utilities/PrivacyHelper.java
|
| diff --git a/clank/test/geppetto/clanktests/src/com/google/android/apps/chrome/uiautomator/utilities/PrivacyHelper.java b/clank/test/geppetto/clanktests/src/com/google/android/apps/chrome/uiautomator/utilities/PrivacyHelper.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..28e1b9a823dfa6a39af12c30fabbecaecf1f4628
|
| --- /dev/null
|
| +++ b/clank/test/geppetto/clanktests/src/com/google/android/apps/chrome/uiautomator/utilities/PrivacyHelper.java
|
| @@ -0,0 +1,38 @@
|
| +// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +package com.google.android.apps.chrome.uiautomator.utilities;
|
| +
|
| +import android.support.test.uiautomator.UiDevice;
|
| +import android.support.test.uiautomator.UiObject;
|
| +import android.support.test.uiautomator.UiObjectNotFoundException;
|
| +import android.support.test.uiautomator.UiSelector;
|
| +
|
| +import com.google.android.apps.uiautomator.utilities.HelperBase;
|
| +
|
| +/**
|
| + * Helper for interacting with the Privacy menu.
|
| + */
|
| +public class PrivacyHelper extends HelperBase {
|
| + private final UiObject mUsageAndCrashReports;
|
| +
|
| + public PrivacyHelper(UiDevice uiDevice) {
|
| + super(uiDevice);
|
| + mUsageAndCrashReports = getDevice().findObject(new UiSelector()
|
| + .text("Usage and crash reports").className("android.widget.TextView"));
|
| + }
|
| +
|
| + /**
|
| + * Turn on usage and crash reports.
|
| + */
|
| + public void turnOnUsageAndCrashReports() throws UiObjectNotFoundException {
|
| + mUsageAndCrashReports.click();
|
| + try {
|
| + getDevice().findObject(new UiSelector().text("Always send")).click();
|
| + } catch (Exception e) {
|
| + }
|
| + getDevice().findObject(new UiSelector().description("Navigate up")
|
| + .className("android.widget.ImageButton")).click();
|
| + }
|
| +}
|
|
|