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

Side by Side Diff: chrome_elf/create_file/chrome_create_file_unittest.cc

Issue 183833004: Make chrome_elf use thunks instead of function pointers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_elf/create_file/chrome_create_file.h" 5 #include "chrome_elf/create_file/chrome_create_file.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include <bitset> 9 #include <bitset>
10 #include <string> 10 #include <string>
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 EXPECT_FALSE(ShouldBypass(desktop_junk_path.value().c_str())); 370 EXPECT_FALSE(ShouldBypass(desktop_junk_path.value().c_str()));
371 EXPECT_FALSE(ShouldBypass(desktop_prefs_path.value().c_str())); 371 EXPECT_FALSE(ShouldBypass(desktop_prefs_path.value().c_str()));
372 372
373 // Only redirect "Preferences" and "Local State" files. 373 // Only redirect "Preferences" and "Local State" files.
374 EXPECT_TRUE(ShouldBypass(local_prefs_path.value().c_str())); 374 EXPECT_TRUE(ShouldBypass(local_prefs_path.value().c_str()));
375 EXPECT_TRUE(ShouldBypass(local_state_path.value().c_str())); 375 EXPECT_TRUE(ShouldBypass(local_state_path.value().c_str()));
376 EXPECT_FALSE(ShouldBypass(local_junk_path.value().c_str())); 376 EXPECT_FALSE(ShouldBypass(local_junk_path.value().c_str()));
377 } 377 }
378 378
379 TEST_F(ChromeCreateFileTest, NtCreateFileAddressCheck) { 379 TEST_F(ChromeCreateFileTest, NtCreateFileAddressCheck) {
380 HMODULE ntdll_handle = ::GetModuleHandle(L"ntdll.dll"); 380 EXPECT_EQ(&g_nt_thunk_storage, g_ntdll_lookup["NtCreateFile"]);
381 EXPECT_EQ(::GetProcAddress(ntdll_handle, "NtCreateFile"),
382 g_ntdll_lookup["NtCreateFile"]);
383 } 381 }
384 382
385 TEST_F(ChromeCreateFileTest, ReadWriteFromNtDll) { 383 TEST_F(ChromeCreateFileTest, ReadWriteFromNtDll) {
386 base::FilePath file_name = temp_dir_.path().Append(L"some_file.txt"); 384 base::FilePath file_name = temp_dir_.path().Append(L"some_file.txt");
387 DoWriteCheck(file_name, FILE_ATTRIBUTE_NORMAL, false); 385 DoWriteCheck(file_name, FILE_ATTRIBUTE_NORMAL, false);
388 DoReadCheck(file_name, FILE_ATTRIBUTE_NORMAL, false); 386 DoReadCheck(file_name, FILE_ATTRIBUTE_NORMAL, false);
389 } 387 }
390 388
391 } // namespace 389 } // namespace
OLDNEW
« no previous file with comments | « chrome_elf/chrome_elf.gyp ('k') | chrome_elf/ntdll_cache.h » ('j') | chrome_elf/ntdll_cache.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698