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

Unified Diff: tools/telemetry/telemetry/internal/browser/extension_to_load.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/internal/browser/extension_to_load.py
diff --git a/tools/telemetry/telemetry/internal/browser/extension_to_load.py b/tools/telemetry/telemetry/internal/browser/extension_to_load.py
deleted file mode 100644
index e40e3756c29667fcf5728519e278eec98117b27e..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/internal/browser/extension_to_load.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# 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.
-import os
-
-from telemetry.internal.backends.chrome import crx_id
-
-
-class ExtensionPathNonExistentException(Exception):
- pass
-
-class MissingPublicKeyException(Exception):
- pass
-
-class ExtensionToLoad(object):
- def __init__(self, path, browser_type, is_component=False):
- if not os.path.isdir(path):
- raise ExtensionPathNonExistentException(
- 'Extension path not a directory %s' % path)
- self._path = path
- self._local_path = path
- self._is_component = is_component
- if is_component and not crx_id.HasPublicKey(path):
- raise MissingPublicKeyException(
- 'Component extension %s must have a public key' % path)
-
- # It is possible that we are running telemetry on Windows targeting
- # a remote CrOS or Android device. In this case, we need the
- # browser_type argument to determine how we should encode
- # the extension path.
- self._is_win = (os.name == 'nt'
- and not (browser_type.startswith('android')
- or browser_type.startswith('cros')))
-
- @property
- def extension_id(self):
- """Unique extension id of this extension."""
- if crx_id.HasPublicKey(self._path):
- # Calculate extension id from the public key.
- return crx_id.GetCRXAppID(os.path.realpath(self._path))
- else:
- # Calculate extension id based on the path on the device.
- return crx_id.GetCRXAppID(
- os.path.realpath(self._local_path),
- from_file_path=True,
- is_win_path=self._is_win)
-
- @property
- def path(self):
- """Path to extension source directory."""
- return self._path
-
- @property
- def local_path(self):
- """Path to extension destination directory, for remote instances of
- chrome"""
- return self._local_path
-
- @local_path.setter
- def local_path(self, local_path):
- self._local_path = local_path
-
- @property
- def is_component(self):
- """Whether this extension should be loaded as a component extension."""
- return self._is_component

Powered by Google App Engine
This is Rietveld 408576698