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

Side by Side Diff: sandbox/win/src/address_sanitizer_test.cc

Issue 1118473005: Apply automated fixits for Chrome clang plugin to sandbox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | sandbox/win/src/eat_resolver.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <stdio.h> 5 #include <stdio.h>
6 6
7 #include "base/environment.h" 7 #include "base/environment.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/win/scoped_handle.h" 12 #include "base/win/scoped_handle.h"
13 #include "base/win/windows_version.h" 13 #include "base/win/windows_version.h"
14 #include "sandbox/win/tests/common/controller.h" 14 #include "sandbox/win/tests/common/controller.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 namespace sandbox { 17 namespace sandbox {
18 18
19 class AddressSanitizerTests : public ::testing::Test { 19 class AddressSanitizerTests : public ::testing::Test {
20 public: 20 public:
21 void SetUp() { 21 void SetUp() override {
22 env_.reset(base::Environment::Create()); 22 env_.reset(base::Environment::Create());
23 had_asan_options_ = env_->GetVar("ASAN_OPTIONS", &old_asan_options_); 23 had_asan_options_ = env_->GetVar("ASAN_OPTIONS", &old_asan_options_);
24 } 24 }
25 25
26 void TearDown() { 26 void TearDown() override {
27 if (had_asan_options_) 27 if (had_asan_options_)
28 ASSERT_TRUE(env_->SetVar("ASAN_OPTIONS", old_asan_options_)); 28 ASSERT_TRUE(env_->SetVar("ASAN_OPTIONS", old_asan_options_));
29 else 29 else
30 env_->UnSetVar("ASAN_OPTIONS"); 30 env_->UnSetVar("ASAN_OPTIONS");
31 } 31 }
32 32
33 protected: 33 protected:
34 scoped_ptr<base::Environment> env_; 34 scoped_ptr<base::Environment> env_;
35 bool had_asan_options_; 35 bool had_asan_options_;
36 std::string old_asan_options_; 36 std::string old_asan_options_;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 << "The stack trace doesn't have a correct filename:\n" << data; 98 << "The stack trace doesn't have a correct filename:\n" << data;
99 } else { 99 } else {
100 LOG(WARNING) << "Pre-Vista versions are not supported."; 100 LOG(WARNING) << "Pre-Vista versions are not supported.";
101 } 101 }
102 } else { 102 } else {
103 LOG(WARNING) << "Not an AddressSanitizer build, skipping the run."; 103 LOG(WARNING) << "Not an AddressSanitizer build, skipping the run.";
104 } 104 }
105 } 105 }
106 106
107 } 107 }
OLDNEW
« no previous file with comments | « no previous file | sandbox/win/src/eat_resolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698