• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/corennnnn


Commit MetaInfo

Revisão8206c1caf4be216403c8d23998e3a38d5c43ac92 (tree)
Hora2016-08-16 08:04:16
AutorFelipe Leme <felipeal@goog...>
CommiterFelipe Leme

Mensagem de Log

Split 'generating' and 'pulling' in 2 messages.

*** Cherrypicked from 9c0be90528baee54182334048af467e3dde74d72 ***

Change-Id: I00067fe160ca9e5351a8767b159d5f1d698083b4
Fixes: 30799929

Mudança Sumário

Diff

--- a/adb/bugreport.cpp
+++ b/adb/bugreport.cpp
@@ -47,7 +47,7 @@ class BugreportStandardStreamsCallback : public StandardStreamsCallbackInterface
4747 show_progress_(show_progress),
4848 status_(0),
4949 line_() {
50- SetLineMessage();
50+ SetLineMessage("generating");
5151 }
5252
5353 void OnStdout(const char* buffer, int length) {
@@ -97,6 +97,7 @@ class BugreportStandardStreamsCallback : public StandardStreamsCallbackInterface
9797 OS_PATH_SEPARATOR, dest_file_.c_str());
9898 }
9999 std::vector<const char*> srcs{src_file_.c_str()};
100+ SetLineMessage("pulling");
100101 status_ =
101102 br_->DoSyncPull(srcs, destination.c_str(), true, line_message_.c_str()) ? 0 : 1;
102103 if (status_ != 0) {
@@ -111,9 +112,8 @@ class BugreportStandardStreamsCallback : public StandardStreamsCallbackInterface
111112 }
112113
113114 private:
114- void SetLineMessage() {
115- line_message_ =
116- android::base::StringPrintf("generating %s", adb_basename(dest_file_).c_str());
115+ void SetLineMessage(const std::string& action) {
116+ line_message_ = action + " " + adb_basename(dest_file_);
117117 }
118118
119119 void SetSrcFile(const std::string path) {
@@ -121,7 +121,7 @@ class BugreportStandardStreamsCallback : public StandardStreamsCallbackInterface
121121 if (!dest_dir_.empty()) {
122122 // Only uses device-provided name when user passed a directory.
123123 dest_file_ = adb_basename(path);
124- SetLineMessage();
124+ SetLineMessage("generating");
125125 }
126126 }
127127
--- a/adb/bugreport_test.cpp
+++ b/adb/bugreport_test.cpp
@@ -189,7 +189,7 @@ TEST_F(BugreportTest, NoArgumentsNDevice) {
189189 .WillOnce(DoAll(WithArg<4>(WriteOnStdout("OK:/device/da_bugreport.zip")),
190190 WithArg<4>(ReturnCallbackDone())));
191191 EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file),
192- true, StrEq("generating da_bugreport.zip")))
192+ true, StrEq("pulling da_bugreport.zip")))
193193 .WillOnce(Return(true));
194194
195195 const char* args[] = {"bugreport"};
@@ -209,7 +209,7 @@ TEST_F(BugreportTest, NoArgumentsPostNDevice) {
209209 WithArg<4>(WriteOnStdout("OK:/device/da_bugreport.zip\n")),
210210 WithArg<4>(ReturnCallbackDone())));
211211 EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file),
212- true, StrEq("generating da_bugreport.zip")))
212+ true, StrEq("pulling da_bugreport.zip")))
213213 .WillOnce(Return(true));
214214
215215 const char* args[] = {"bugreport"};
@@ -223,7 +223,7 @@ TEST_F(BugreportTest, OkNDevice) {
223223 .WillOnce(DoAll(WithArg<4>(WriteOnStdout("OK:/device/bugreport.zip")),
224224 WithArg<4>(ReturnCallbackDone())));
225225 EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
226- true, StrEq("generating file.zip")))
226+ true, StrEq("pulling file.zip")))
227227 .WillOnce(Return(true));
228228
229229 const char* args[] = {"bugreport", "file.zip"};
@@ -239,7 +239,7 @@ TEST_F(BugreportTest, OkNDeviceSplitBuffer) {
239239 WithArg<4>(WriteOnStdout("/bugreport.zip")),
240240 WithArg<4>(ReturnCallbackDone())));
241241 EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
242- true, StrEq("generating file.zip")))
242+ true, StrEq("pulling file.zip")))
243243 .WillOnce(Return(true));
244244
245245 const char* args[] = {"bugreport", "file.zip"};
@@ -275,7 +275,7 @@ TEST_F(BugreportTest, OkProgress) {
275275 WithArg<4>(ReturnCallbackDone())));
276276 // clang-format on
277277 EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
278- true, StrEq("generating file.zip")))
278+ true, StrEq("pulling file.zip")))
279279 .WillOnce(Return(true));
280280
281281 const char* args[] = {"bugreport", "file.zip"};
@@ -294,7 +294,7 @@ TEST_F(BugreportTest, OkDirectory) {
294294 WithArg<4>(WriteOnStdout("OK:/device/da_bugreport.zip")),
295295 WithArg<4>(ReturnCallbackDone())));
296296 EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file),
297- true, StrEq("generating da_bugreport.zip")))
297+ true, StrEq("pulling da_bugreport.zip")))
298298 .WillOnce(Return(true));
299299
300300 const char* args[] = {"bugreport", td.path};
@@ -308,7 +308,7 @@ TEST_F(BugreportTest, OkNoExtension) {
308308 .WillOnce(DoAll(WithArg<4>(WriteOnStdout("OK:/device/bugreport.zip\n")),
309309 WithArg<4>(ReturnCallbackDone())));
310310 EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/bugreport.zip")), StrEq("file.zip"),
311- true, StrEq("generating file.zip")))
311+ true, StrEq("pulling file.zip")))
312312 .WillOnce(Return(true));
313313
314314 const char* args[] = {"bugreport", "file"};
@@ -327,7 +327,7 @@ TEST_F(BugreportTest, OkNDeviceDirectory) {
327327 WithArg<4>(WriteOnStdout("OK:/device/da_bugreport.zip")),
328328 WithArg<4>(ReturnCallbackDone())));
329329 EXPECT_CALL(br_, DoSyncPull(ElementsAre(StrEq("/device/da_bugreport.zip")), StrEq(dest_file),
330- true, StrEq("generating da_bugreport.zip")))
330+ true, StrEq("pulling da_bugreport.zip")))
331331 .WillOnce(Return(true));
332332
333333 const char* args[] = {"bugreport", td.path};