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

Unified Diff: util/win/critical_section_with_debug_info_test.cc

Issue 1405243002: Fix CRITICAL_SECTION test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 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 | « util/win/critical_section_with_debug_info.cc ('k') | util/win/registration_protocol_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/win/critical_section_with_debug_info_test.cc
diff --git a/util/win/time_test.cc b/util/win/critical_section_with_debug_info_test.cc
similarity index 66%
copy from util/win/time_test.cc
copy to util/win/critical_section_with_debug_info_test.cc
index ad0771e38b7889ab92154490845a0c3aafe13782..dcc596559ccee9862a7127578cc19e20fc04b938 100644
--- a/util/win/time_test.cc
+++ b/util/win/critical_section_with_debug_info_test.cc
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "util/win/time.h"
+#include "util/win/critical_section_with_debug_info.h"
#include "gtest/gtest.h"
@@ -20,13 +20,13 @@ namespace crashpad {
namespace test {
namespace {
-TEST(Time, Reasonable) {
- timeval t;
- GetTimeOfDay(&t);
- // Assume that time's time_t return is seconds from 1970.
- time_t approx_now = time(nullptr);
- EXPECT_GE(approx_now, t.tv_sec);
- EXPECT_LT(approx_now - 100, t.tv_sec);
+TEST(CriticalSectionWithDebugInfo, CriticalSectionWithDebugInfo) {
+ CRITICAL_SECTION critical_section;
+ ASSERT_TRUE(
+ InitializeCriticalSectionWithDebugInfoIfPossible(&critical_section));
+ EnterCriticalSection(&critical_section);
+ LeaveCriticalSection(&critical_section);
+ DeleteCriticalSection(&critical_section);
}
} // namespace
« no previous file with comments | « util/win/critical_section_with_debug_info.cc ('k') | util/win/registration_protocol_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698