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

Unified Diff: chrome_frame/crash_reporting/vectored_handler_unittest.cc

Issue 3076042: Use Environment::SetVar in more places. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: rebased to ToT Created 10 years, 4 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 | « chrome_frame/crash_reporting/nt_loader_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/crash_reporting/vectored_handler_unittest.cc
diff --git a/chrome_frame/crash_reporting/vectored_handler_unittest.cc b/chrome_frame/crash_reporting/vectored_handler_unittest.cc
index d17847b6ac173eef4a1c2a85489e9e61073006a2..4153646aeb49d170d0ed666fdd81dbe07353cf06 100644
--- a/chrome_frame/crash_reporting/vectored_handler_unittest.cc
+++ b/chrome_frame/crash_reporting/vectored_handler_unittest.cc
@@ -1,10 +1,13 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <atlbase.h>
+#include "base/environment.h"
#include "base/logging.h"
+#include "base/scoped_ptr.h"
+#include "base/utf_string_conversions.h"
#include "chrome_frame/crash_reporting/crash_dll.h"
#include "chrome_frame/crash_reporting/nt_loader.h"
#include "chrome_frame/crash_reporting/vectored_handler-impl.h"
@@ -138,18 +141,19 @@ TEST(ChromeFrame, ExceptionReport) {
g_mock_veh = &veh;
void* id = ::AddVectoredExceptionHandler(FALSE, VEH);
- EXPECT_TRUE(::SetEnvironmentVariable(kCrashOnLoadMode, L"1"));
+ scoped_ptr<base::Environment> env(base::Environment::Create());
+ EXPECT_TRUE(env->SetVar(WideToUTF8(kCrashOnLoadMode).c_str(), "1"));
long exceptions_seen = veh.get_exceptions_seen();
HMODULE module = ::LoadLibrary(kCrashDllName);
EXPECT_EQ(NULL, module);
testing::Mock::VerifyAndClearExpectations(&api);
EXPECT_EQ(exceptions_seen + 1, veh.get_exceptions_seen());
- EXPECT_TRUE(::SetEnvironmentVariable(kCrashOnLoadMode, NULL));
+ EXPECT_TRUE(env->UnSetVar(WideToUTF8(kCrashOnLoadMode).c_str()));
// Exception in an unloading module, we are on the stack/
// Make sure we report it.
- EXPECT_TRUE(::SetEnvironmentVariable(kCrashOnUnloadMode, L"1"));
+ EXPECT_TRUE(env->SetVar(WideToUTF8(kCrashOnUnloadMode).c_str(), "1"));
module = ::LoadLibrary(kCrashDllName);
« no previous file with comments | « chrome_frame/crash_reporting/nt_loader_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698