Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Unified Diff: tools/telemetry/telemetry/util/mac/keychain_helper.py

Issue 1647513002: Delete tools/telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/util/mac/keychain_helper.py
diff --git a/tools/telemetry/telemetry/util/mac/keychain_helper.py b/tools/telemetry/telemetry/util/mac/keychain_helper.py
deleted file mode 100644
index 40219eae8e7ed22656c32213e6807215a44be382..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/util/mac/keychain_helper.py
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright 2014 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.
-
-import subprocess
-
-from telemetry.internal.util import binary_manager
-from telemetry.core import platform
-from telemetry.core import os_version
-
-def _PathForExecutable(executable_name):
- """Fetches the executable from cloud storage, and returns its path."""
- arch_name = platform.GetHostPlatform().GetArchName()
- return binary_manager.FetchPath(executable_name, arch_name, 'mac')
-
-def IsKeychainLocked():
- """
- Returns True if the keychain is locked, or if there is an error determining
- the keychain state.
- """
- path = _PathForExecutable('determine_if_keychain_is_locked')
-
- child = subprocess.Popen(path, stdout=subprocess.PIPE)
- child.communicate()
- return child.returncode != 0
-
-def DoesKeychainHaveTimeout():
- """
- Returns True if the keychain will lock itself have a period of time.
-
- This method will trigger a blocking, modal dialog if the keychain is
- locked.
- """
- command = ("/usr/bin/security", "show-keychain-info")
- child = subprocess.Popen(command, stderr=subprocess.PIPE)
- stderr = child.communicate()[1]
- return "no-timeout" not in stderr
-
-def _IsKeychainConfiguredForBots(service_name, account_name):
- """
- Returns True if the keychain entry associated with |service_name| and
- |account_name| is correctly configured for running telemetry tests on bots.
-
- This method will trigger a blocking, modal dialog if the keychain is
- locked.
- """
- # The executable requires OSX 10.7+ APIs.
- if (platform.GetHostPlatform().GetOSVersionName() <
- os_version.LION):
- return False
-
- path = _PathForExecutable('determine_if_keychain_entry_is_decryptable')
-
- command = (path, service_name, account_name)
- child = subprocess.Popen(command)
- child.communicate()
- return child.returncode == 0
-
-def IsKeychainConfiguredForBotsWithChrome():
- return _IsKeychainConfiguredForBots("Chrome Safe Storage",
- "Chrome")
-
-def IsKeychainConfiguredForBotsWithChromium():
- return _IsKeychainConfiguredForBots("Chromium Safe Storage",
- "Chromium")

Powered by Google App Engine
This is Rietveld 408576698