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

Side by Side Diff: third_party/crashpad/crashpad/util/win/session_end_watcher_test.cc

Issue 2710663006: Update Crashpad to 4a2043ea65e2641ef1a921801c0aaa15ada02fc7 (Closed)
Patch Set: Update Crashpad to 4a2043ea65e2 Created 3 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
OLDNEW
(Empty)
1 // Copyright 2017 The Crashpad Authors. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #include "util/win/session_end_watcher.h"
16
17 #include "gtest/gtest.h"
18 #include "test/errors.h"
19
20 namespace crashpad {
21 namespace test {
22 namespace {
23
24 class SessionEndWatcherTest final : public SessionEndWatcher {
25 public:
26 SessionEndWatcherTest() : SessionEndWatcher(), called_(false) {}
27
28 ~SessionEndWatcherTest() override {}
29
30 void Run() {
31 WaitForStart();
32
33 HWND window = GetWindow();
34 ASSERT_TRUE(window);
35 EXPECT_TRUE(PostMessage(window, WM_ENDSESSION, 1, 0));
36
37 WaitForStop();
38
39 EXPECT_TRUE(called_);
40 }
41
42 private:
43 // SessionEndWatcher:
44 void SessionEnding() override { called_ = true; }
45
46 bool called_;
47
48 DISALLOW_COPY_AND_ASSIGN(SessionEndWatcherTest);
49 };
50
51 TEST(SessionEndWatcher, SessionEndWatcher) {
52 SessionEndWatcherTest test;
53 test.Run();
54 }
55
56 TEST(SessionEndWatcher, DoNothing) {
57 SessionEndWatcherTest test;
58 }
59
60 } // namespace
61 } // namespace test
62 } // namespace crashpad
OLDNEW
« no previous file with comments | « third_party/crashpad/crashpad/util/win/session_end_watcher.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698