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

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

Issue 189803007: Revert 255151 "Make chrome_elf use thunks instead of function po..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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
« no previous file with comments | « trunk/src/chrome_elf/chrome_elf.gyp ('k') | trunk/src/chrome_elf/ntdll_cache.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 EXPECT_EQ(&g_nt_thunk_storage, g_ntdll_lookup["NtCreateFile"]); 380 HMODULE ntdll_handle = ::GetModuleHandle(L"ntdll.dll");
381 EXPECT_EQ(::GetProcAddress(ntdll_handle, "NtCreateFile"),
382 g_ntdll_lookup["NtCreateFile"]);
381 } 383 }
382 384
383 TEST_F(ChromeCreateFileTest, ReadWriteFromNtDll) { 385 TEST_F(ChromeCreateFileTest, ReadWriteFromNtDll) {
384 base::FilePath file_name = temp_dir_.path().Append(L"some_file.txt"); 386 base::FilePath file_name = temp_dir_.path().Append(L"some_file.txt");
385 DoWriteCheck(file_name, FILE_ATTRIBUTE_NORMAL, false); 387 DoWriteCheck(file_name, FILE_ATTRIBUTE_NORMAL, false);
386 DoReadCheck(file_name, FILE_ATTRIBUTE_NORMAL, false); 388 DoReadCheck(file_name, FILE_ATTRIBUTE_NORMAL, false);
387 } 389 }
388 390
389 } // namespace 391 } // namespace
OLDNEW
« no previous file with comments | « trunk/src/chrome_elf/chrome_elf.gyp ('k') | trunk/src/chrome_elf/ntdll_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698