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

Unified Diff: base/system_unittest.cc

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « base/system_info_unittest.cc ('k') | base/thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/system_unittest.cc
diff --git a/base/system_unittest.cc b/base/system_unittest.cc
deleted file mode 100644
index 4eae20671e055793106347d0fe6cb74d90e3145a..0000000000000000000000000000000000000000
--- a/base/system_unittest.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2003-2009 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-// ========================================================================
-// System unittest
-//
-// TODO(omaha): there are some untested functions: memory stats, thread
-// priorities, getdirsize (that's mine), backup/restore of registry trees.. not
-// sure how high priority it is to test these things but should probably be
-// added
-
-#include "omaha/base/system.h"
-#include "omaha/testing/unit_test.h"
-
-namespace omaha {
-
-TEST(SystemTest, System) {
- uint32 time_waited = 0;
- ASSERT_SUCCEEDED(System::WaitForDiskActivity(10000, 25, &time_waited));
-
- uint64 free_bytes_current_user = 0;
- uint64 total_bytes_current_user = 0;
- uint64 free_bytes_all_users = 0;
- ASSERT_SUCCEEDED(System::GetDiskStatistics(_T("C:\\"),
- &free_bytes_current_user,
- &total_bytes_current_user,
- &free_bytes_all_users));
-
- ASSERT_EQ(System::GetProcessHandleCount(),
- System::GetProcessHandleCountOld());
-}
-
-// Assume the workstations and PULSE are not running on batteries. The test
-// fails on laptops running on batteries.
-TEST(SystemTest, IsRunningOnBatteries) {
- ASSERT_FALSE(System::IsRunningOnBatteries());
-}
-
-TEST(SystemTest, GetProcessMemoryStatistics) {
- uint64 current_working_set(0);
- uint64 peak_working_set(0);
- uint64 min_working_set_size(0);
- uint64 max_working_set_size(0);
- ASSERT_HRESULT_SUCCEEDED(
- System::GetProcessMemoryStatistics(&current_working_set,
- &peak_working_set,
- &min_working_set_size,
- &max_working_set_size));
- EXPECT_LT(0, current_working_set);
- EXPECT_LT(0, peak_working_set);
- EXPECT_LT(0, min_working_set_size);
- EXPECT_LT(0, max_working_set_size);
-}
-
-TEST(SystemTest, GetProcessHandleCount) {
- DWORD handle_count(0);
- ASSERT_TRUE(::GetProcessHandleCount(::GetCurrentProcess(), &handle_count));
- EXPECT_LE(0u, handle_count);
- EXPECT_EQ(handle_count, System::GetProcessHandleCount());
-}
-
-} // namespace omaha
-
« no previous file with comments | « base/system_info_unittest.cc ('k') | base/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698