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

Side by Side Diff: testing/embedder_test_timer_handling_delegate.h

Issue 1411043008: Fix the build after commit 8cadf995e9a0. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years, 1 month 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 | « fpdfsdk/src/fpdfformfill_embeddertest.cpp ('k') | no next file » | 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 PDFium Authors. All rights reserved. 1 // Copyright 2015 PDFium 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 #ifndef TESTING_EMBEDDER_TEST_TIMER_HANDLING_DELEGATE_H_ 5 #ifndef TESTING_EMBEDDER_TEST_TIMER_HANDLING_DELEGATE_H_
6 #define TESTING_EMBEDDER_TEST_TIMER_HANDLING_DELEGATE_H_ 6 #define TESTING_EMBEDDER_TEST_TIMER_HANDLING_DELEGATE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string>
9 #include <utility> 10 #include <utility>
10 #include <vector> 11 #include <vector>
11 12
12 #include "embedder_test.h" 13 #include "embedder_test.h"
14 #include "test_support.h"
13 15
14 class EmbedderTestTimerHandlingDelegate : public EmbedderTest::Delegate { 16 class EmbedderTestTimerHandlingDelegate : public EmbedderTest::Delegate {
15 public: 17 public:
16 struct ReceivedAlert { 18 struct ReceivedAlert {
17 ReceivedAlert(FPDF_WIDESTRING message_in, 19 ReceivedAlert(FPDF_WIDESTRING message_in,
18 FPDF_WIDESTRING title_in, 20 FPDF_WIDESTRING title_in,
19 int type_in, 21 int type_in,
20 int icon_in) 22 int icon_in)
21 : message(message_in), title(title_in), type(type_in), icon(icon_in) {} 23 : type(type_in), icon(icon_in) {
24 message = GetWideString(message_in);
25 title = GetWideString(title_in);
26 }
22 27
23 FPDF_WIDESTRING message; 28 std::wstring message;
24 FPDF_WIDESTRING title; 29 std::wstring title;
25 int type; 30 int type;
26 int icon; 31 int icon;
27 }; 32 };
28 33
29 int Alert(FPDF_WIDESTRING message, 34 int Alert(FPDF_WIDESTRING message,
30 FPDF_WIDESTRING title, 35 FPDF_WIDESTRING title,
31 int type, 36 int type,
32 int icon) override { 37 int icon) override {
33 alerts_.push_back(ReceivedAlert(message, title, type, icon)); 38 alerts_.push_back(ReceivedAlert(message, title, type, icon));
34 return 0; 39 return 0;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 75
71 protected: 76 protected:
72 using Timer = std::pair<int, TimerCallback>; // ID, callback pair. 77 using Timer = std::pair<int, TimerCallback>; // ID, callback pair.
73 std::multimap<int, Timer> expiry_to_timer_map_; // Keyed by timeout. 78 std::multimap<int, Timer> expiry_to_timer_map_; // Keyed by timeout.
74 int next_timer_id_ = 0; 79 int next_timer_id_ = 0;
75 int imaginary_elapsed_msecs_ = 0; 80 int imaginary_elapsed_msecs_ = 0;
76 std::vector<ReceivedAlert> alerts_; 81 std::vector<ReceivedAlert> alerts_;
77 }; 82 };
78 83
79 #endif // TESTING_EMBEDDER_TEST_TIMER_HANDLING_DELEGATE_H_ 84 #endif // TESTING_EMBEDDER_TEST_TIMER_HANDLING_DELEGATE_H_
OLDNEW
« no previous file with comments | « fpdfsdk/src/fpdfformfill_embeddertest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698