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

Unified Diff: snapshot/win/process_reader_win_test.cc

Issue 1052813002: win: make CrashpadInfo retrievable (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: more fixes 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « snapshot/win/process_reader_win.cc ('k') | snapshot/win/process_snapshot_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/win/process_reader_win_test.cc
diff --git a/util/win/time_test.cc b/snapshot/win/process_reader_win_test.cc
similarity index 51%
copy from util/win/time_test.cc
copy to snapshot/win/process_reader_win_test.cc
index ad0771e38b7889ab92154490845a0c3aafe13782..e7c478ea5b31be431a85c2ea2d659cbcbb1cf04a 100644
--- a/util/win/time_test.cc
+++ b/snapshot/win/process_reader_win_test.cc
@@ -12,7 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "util/win/time.h"
+#include "snapshot/win/process_reader_win.h"
+
+#include <windows.h>
#include "gtest/gtest.h"
@@ -20,13 +22,25 @@ 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(ProcessReaderWin, SelfBasic) {
+ ProcessReaderWin process_reader;
+ ASSERT_TRUE(process_reader.Initialize(GetCurrentProcess()));
+
+#if !defined(ARCH_CPU_64_BITS)
+ EXPECT_FALSE(process_reader.Is64Bit());
+#else
+ EXPECT_TRUE(process_reader.Is64Bit());
+#endif
+
+ EXPECT_EQ(GetCurrentProcessId(), process_reader.ProcessID());
+
+ const char kTestMemory[] = "Some test memory";
+ char buffer[arraysize(kTestMemory)];
+ ASSERT_TRUE(
+ process_reader.ReadMemory(reinterpret_cast<uintptr_t>(kTestMemory),
+ sizeof(kTestMemory),
+ &buffer));
+ EXPECT_STREQ(kTestMemory, buffer);
}
} // namespace
« no previous file with comments | « snapshot/win/process_reader_win.cc ('k') | snapshot/win/process_snapshot_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698