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

Unified Diff: content/browser/payments/payment_app_context_impl_unittest.cc

Issue 2585303002: PaymentApp: Fix params order of EXPECT/ASSERTs in unit tests. (Closed)
Patch Set: Created 4 years 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
Index: content/browser/payments/payment_app_context_impl_unittest.cc
diff --git a/content/browser/payments/payment_app_context_impl_unittest.cc b/content/browser/payments/payment_app_context_impl_unittest.cc
index 213e02129c76fe9a7ac4d280c59c19ef344efe12..4f433f5c009ab04f49326e94089c4fdea45fd45b 100644
--- a/content/browser/payments/payment_app_context_impl_unittest.cc
+++ b/content/browser/payments/payment_app_context_impl_unittest.cc
@@ -71,7 +71,7 @@ class PaymentAppContextTest : public PaymentAppContentUnitTestBase {
base::Bind(&SetManifestCallback, &called, &error));
ASSERT_TRUE(called);
- ASSERT_EQ(error, payments::mojom::PaymentAppManifestError::NONE);
+ ASSERT_EQ(payments::mojom::PaymentAppManifestError::NONE, error);
}
private:
@@ -97,17 +97,17 @@ TEST_F(PaymentAppContextTest, Test) {
GetAllManifests(base::Bind(&GetAllManifestsCallback, &called, &manifests));
ASSERT_TRUE(called);
- ASSERT_EQ(manifests.size(), 3U);
+ ASSERT_EQ(3U, manifests.size());
size_t i = 0;
for (const auto& manifest : manifests) {
- EXPECT_EQ(manifest.second->icon.value(), "payment-app-icon");
- EXPECT_EQ(manifest.second->name, kPaymentAppInfo[i++].scopeUrl);
- ASSERT_EQ(manifest.second->options.size(), 1U);
- EXPECT_EQ(manifest.second->options[0]->icon.value(), "payment-app-icon");
- EXPECT_EQ(manifest.second->options[0]->name, "Visa ****");
- EXPECT_EQ(manifest.second->options[0]->id, "payment-app-id");
- ASSERT_EQ(manifest.second->options[0]->enabled_methods.size(), 1U);
- EXPECT_EQ(manifest.second->options[0]->enabled_methods[0], "visa");
+ EXPECT_EQ("payment-app-icon", manifest.second->icon.value());
please use gerrit instead 2016/12/19 20:27:58 If you construct an expected manifest, can you com
zino 2016/12/20 17:11:28 Done. I agree with you. It makes the codes simple
please use gerrit instead 2016/12/20 17:23:36 You're right, it's better to keep error messages c
+ EXPECT_EQ(kPaymentAppInfo[i++].scopeUrl, manifest.second->name);
+ ASSERT_EQ(1U, manifest.second->options.size());
+ EXPECT_EQ("payment-app-icon", manifest.second->options[0]->icon.value());
+ EXPECT_EQ("Visa ****", manifest.second->options[0]->name);
+ EXPECT_EQ("payment-app-id", manifest.second->options[0]->id);
+ ASSERT_EQ(1U, manifest.second->options[0]->enabled_methods.size());
+ EXPECT_EQ("visa", manifest.second->options[0]->enabled_methods[0]);
}
}

Powered by Google App Engine
This is Rietveld 408576698