OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 stats = GetStats(METRIC_SHARED_MEMORY_USAGE); | 590 stats = GetStats(METRIC_SHARED_MEMORY_USAGE); |
591 ASSERT_EQ(2u, stats.size()); | 591 ASSERT_EQ(2u, stats.size()); |
592 EXPECT_GT(stats[1].value, 0); | 592 EXPECT_GT(stats[1].value, 0); |
593 } | 593 } |
594 | 594 |
595 #if !defined(OS_WIN) | 595 #if !defined(OS_WIN) |
596 // Disabled on Windows due to a bug where Windows will return a normal exit | 596 // Disabled on Windows due to a bug where Windows will return a normal exit |
597 // code in the testing environment, even if the process died (this is not the | 597 // code in the testing environment, even if the process died (this is not the |
598 // case when hand-testing). This code can be traced to MSDN functions in | 598 // case when hand-testing). This code can be traced to MSDN functions in |
599 // base::GetTerminationStatus(), so there's not much we can do. | 599 // base::GetTerminationStatus(), so there's not much we can do. |
600 IN_PROC_BROWSER_TEST_F(PerformanceMonitorBrowserTest, KilledByOSEvent) { | 600 IN_PROC_BROWSER_TEST_F(PerformanceMonitorBrowserTest, RendererKilledEvent) { |
601 content::CrashTab(chrome::GetActiveWebContents(browser())); | 601 content::CrashTab(chrome::GetActiveWebContents(browser())); |
602 | 602 |
603 Database::EventVector events = GetEvents(); | 603 Database::EventVector events = GetEvents(); |
604 | 604 |
605 ASSERT_EQ(1u, events.size()); | 605 ASSERT_EQ(1u, events.size()); |
606 CheckEventType(EVENT_KILLED_BY_OS_CRASH, events[0]); | 606 CheckEventType(EVENT_RENDERER_KILLED, events[0]); |
607 } | 607 } |
608 #endif // !defined(OS_WIN) | 608 #endif // !defined(OS_WIN) |
609 | 609 |
610 IN_PROC_BROWSER_TEST_F(PerformanceMonitorBrowserTest, RendererCrashEvent) { | 610 IN_PROC_BROWSER_TEST_F(PerformanceMonitorBrowserTest, RendererCrashEvent) { |
611 content::WindowedNotificationObserver windowed_observer( | 611 content::WindowedNotificationObserver windowed_observer( |
612 content::NOTIFICATION_RENDERER_PROCESS_CLOSED, | 612 content::NOTIFICATION_RENDERER_PROCESS_CLOSED, |
613 content::NotificationService::AllSources()); | 613 content::NotificationService::AllSources()); |
614 | 614 |
615 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUICrashURL)); | 615 ui_test_utils::NavigateToURL(browser(), GURL(chrome::kChromeUICrashURL)); |
616 | 616 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 test_server()->GetURL(std::string("files/").append("title2.html"))); | 761 test_server()->GetURL(std::string("files/").append("title2.html"))); |
762 | 762 |
763 performance_monitor()->DoTimedCollections(); | 763 performance_monitor()->DoTimedCollections(); |
764 | 764 |
765 metrics = GetStats(METRIC_NETWORK_BYTES_READ); | 765 metrics = GetStats(METRIC_NETWORK_BYTES_READ); |
766 ASSERT_EQ(2u, metrics.size()); | 766 ASSERT_EQ(2u, metrics.size()); |
767 EXPECT_GE(metrics[1].value, page1_size + page2_size); | 767 EXPECT_GE(metrics[1].value, page1_size + page2_size); |
768 } | 768 } |
769 | 769 |
770 } // namespace performance_monitor | 770 } // namespace performance_monitor |
OLD | NEW |