Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / tools / telemetry / telemetry / core / platform / profiler / perf_profiler_unittest.py
index b9370d8..5b11f25 100644 (file)
@@ -19,7 +19,8 @@ class TestPerfProfiler(unittest.TestCase):
 
     profile_file = os.path.join(
         util.GetUnittestDataDir(), 'perf_report_output.txt')
-    perf_report_output = open(profile_file, 'r').read()
+    with open(profile_file) as f:
+      perf_report_output = f.read()
 
     mock_popen = simple_mock.MockObject()
     mock_popen.ExpectCall('communicate').WillReturn([perf_report_output])
@@ -33,7 +34,7 @@ class TestPerfProfiler(unittest.TestCase):
     perf_profiler.subprocess = mock_subprocess
     try:
       self.assertEqual(
-          perf_profiler.PerfProfiler.GetTopSamples('linux', profile_file, 10),
+          perf_profiler.PerfProfiler.GetTopSamples(profile_file, 10),
           { 'v8::internal::StaticMarkingVisitor::MarkMapContents': 63615201,
             'v8::internal::RelocIterator::next': 38271931,
             'v8::internal::LAllocator::MeetConstraintsBetween': 42913933,