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

Side by Side Diff: chrome/browser/chromeos/policy/device_status_collector_browsertest.cc

Issue 1067693002: Disable flaky DeviceStatusCollectorTest.TestCPUSamples test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/chromeos/policy/device_status_collector.h" 5 #include "chrome/browser/chromeos/policy/device_status_collector.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 } 859 }
860 GetStatus(); 860 GetStatus();
861 EXPECT_EQ(static_cast<int>(DeviceStatusCollector::kMaxResourceUsageSamples), 861 EXPECT_EQ(static_cast<int>(DeviceStatusCollector::kMaxResourceUsageSamples),
862 status_.system_ram_free().size()); 862 status_.system_ram_free().size());
863 EXPECT_TRUE(status_.has_system_ram_total()); 863 EXPECT_TRUE(status_.has_system_ram_total());
864 // No good way to inject specific test values for available system RAM, so 864 // No good way to inject specific test values for available system RAM, so
865 // just make sure it's > 0. 865 // just make sure it's > 0.
866 EXPECT_GT(status_.system_ram_total(), 0); 866 EXPECT_GT(status_.system_ram_total(), 0);
867 } 867 }
868 868
869 TEST_F(DeviceStatusCollectorTest, TestCPUSamples) { 869 // Test is disabled because it is flaky on Asan bot (See crbug.com/474325)
870 TEST_F(DeviceStatusCollectorTest, DISABLED_TestCPUSamples) {
870 // Mock 100% CPU usage. 871 // Mock 100% CPU usage.
871 std::string full_cpu_usage("cpu 500 0 500 0 0 0 0"); 872 std::string full_cpu_usage("cpu 500 0 500 0 0 0 0");
872 RestartStatusCollector(base::Bind(&GetEmptyVolumeInfo), 873 RestartStatusCollector(base::Bind(&GetEmptyVolumeInfo),
873 base::Bind(&GetFakeCPUStatistics, full_cpu_usage)); 874 base::Bind(&GetFakeCPUStatistics, full_cpu_usage));
874 message_loop_.RunUntilIdle(); 875 message_loop_.RunUntilIdle();
875 GetStatus(); 876 GetStatus();
876 ASSERT_EQ(1, status_.cpu_utilization_pct().size()); 877 ASSERT_EQ(1, status_.cpu_utilization_pct().size());
877 EXPECT_EQ(100, status_.cpu_utilization_pct(0)); 878 EXPECT_EQ(100, status_.cpu_utilization_pct(0));
878 879
879 // Now sample CPU usage again (active usage counters will not increase 880 // Now sample CPU usage again (active usage counters will not increase
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 found_match = true; 1224 found_match = true;
1224 break; 1225 break;
1225 } 1226 }
1226 } 1227 }
1227 EXPECT_TRUE(found_match) << "No matching state for fake network " 1228 EXPECT_TRUE(found_match) << "No matching state for fake network "
1228 << " (" << state.name << ")"; 1229 << " (" << state.name << ")";
1229 } 1230 }
1230 } 1231 }
1231 1232
1232 } // namespace policy 1233 } // namespace policy
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698