| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/timing/Performance.h" | 5 #include "core/timing/Performance.h" |
| 6 | 6 |
| 7 #include "core/testing/DummyPageHolder.h" | 7 #include "core/testing/DummyPageHolder.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 TEST_F(PerformanceTest, LongTaskObserverInstrumentation) { | 38 TEST_F(PerformanceTest, LongTaskObserverInstrumentation) { |
| 39 m_performance->updateLongTaskInstrumentation(); | 39 m_performance->updateLongTaskInstrumentation(); |
| 40 EXPECT_FALSE(hasLongTaskInspectorAgent()); | 40 EXPECT_FALSE(hasLongTaskInspectorAgent()); |
| 41 | 41 |
| 42 // Adding LongTask observer (with filer option) enables instrumentation. | 42 // Adding LongTask observer (with filer option) enables instrumentation. |
| 43 addLongTaskObserver(); | 43 addLongTaskObserver(); |
| 44 m_performance->updateLongTaskInstrumentation(); | 44 m_performance->updateLongTaskInstrumentation(); |
| 45 EXPECT_TRUE(hasLongTaskInspectorAgent()); | 45 EXPECT_TRUE(hasLongTaskInspectorAgent()); |
| 46 | 46 |
| 47 // While LongTask observer is present, updateLongTaskInstrumentation has no ef
fect. | 47 // While LongTask observer is present, updateLongTaskInstrumentation has no |
| 48 // effect. |
| 48 m_performance->updateLongTaskInstrumentation(); | 49 m_performance->updateLongTaskInstrumentation(); |
| 49 EXPECT_TRUE(hasLongTaskInspectorAgent()); | 50 EXPECT_TRUE(hasLongTaskInspectorAgent()); |
| 50 | 51 |
| 51 // Removing LongTask observer disables instrumentation. | 52 // Removing LongTask observer disables instrumentation. |
| 52 removeLongTaskObserver(); | 53 removeLongTaskObserver(); |
| 53 m_performance->updateLongTaskInstrumentation(); | 54 m_performance->updateLongTaskInstrumentation(); |
| 54 EXPECT_FALSE(hasLongTaskInspectorAgent()); | 55 EXPECT_FALSE(hasLongTaskInspectorAgent()); |
| 55 } | 56 } |
| 56 } | 57 } |
| OLD | NEW |