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

Unified Diff: tools/telemetry/telemetry/internal/platform/profiler/perf_profiler_unittest.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/platform/profiler/perf_profiler_unittest.py
diff --git a/tools/telemetry/telemetry/internal/platform/profiler/perf_profiler_unittest.py b/tools/telemetry/telemetry/internal/platform/profiler/perf_profiler_unittest.py
deleted file mode 100644
index 76f0d3d66bc726a5e63d006fc435756ec942b847..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/internal/platform/profiler/perf_profiler_unittest.py
+++ /dev/null
@@ -1,51 +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 logging
-import os
-import unittest
-
-from telemetry.core import util
-from telemetry.internal.platform.profiler import perf_profiler
-from telemetry.testing import options_for_unittests
-from telemetry.testing import simple_mock
-
-
-class TestPerfProfiler(unittest.TestCase):
- def testPerfProfiler(self):
- options = options_for_unittests.GetCopy()
- if not perf_profiler.PerfProfiler.is_supported(options.browser_type):
- logging.warning('PerfProfiler is not supported. Skipping test')
- return
-
- profile_file = os.path.join(
- util.GetUnittestDataDir(), 'perf_report_output.txt')
- with open(profile_file) as f:
- perf_report_output = f.read()
-
- mock_popen = simple_mock.MockObject()
- mock_popen.ExpectCall('communicate').WillReturn([perf_report_output])
-
- mock_subprocess = simple_mock.MockObject()
- mock_subprocess.ExpectCall(
- 'Popen').WithArgs(simple_mock.DONT_CARE).WillReturn(mock_popen)
- mock_subprocess.SetAttribute('PIPE', simple_mock.MockObject())
-
- real_subprocess = perf_profiler.subprocess
- perf_profiler.subprocess = mock_subprocess
- try:
- self.assertEqual(
- perf_profiler.PerfProfiler.GetTopSamples(profile_file, 10),
- {'v8::internal::StaticMarkingVisitor::MarkMapContents': 63615201,
- 'v8::internal::RelocIterator::next': 38271931,
- 'v8::internal::LAllocator::MeetConstraintsBetween': 42913933,
- 'v8::internal::FlexibleBodyVisitor::Visit': 31909537,
- 'v8::internal::LiveRange::CreateAssignedOperand': 42913933,
- 'void v8::internal::RelocInfo::Visit': 96878864,
- 'WebCore::HTMLTokenizer::nextToken': 48240439,
- 'v8::internal::Scanner::ScanIdentifierOrKeyword': 46054550,
- 'sk_memset32_SSE2': 45121317,
- 'v8::internal::HeapObject::Size': 39786862
- })
- finally:
- perf_profiler.subprocess = real_subprocess

Powered by Google App Engine
This is Rietveld 408576698