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

Unified Diff: components/infobars/test/infobar_test.cc

Issue 501393004: Componentize GoogleURLTracker unittest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/google/core/browser/google_url_tracker_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/infobars/test/infobar_test.cc
diff --git a/components/infobars/test/infobar_test.cc b/components/infobars/test/infobar_test.cc
index a2f17bb23a0809435cfa508b389049570b8da5b1..4b3504ede4451fbc5b782e50298f506328e0e80d 100644
--- a/components/infobars/test/infobar_test.cc
+++ b/components/infobars/test/infobar_test.cc
@@ -7,11 +7,11 @@
#include "components/infobars/core/confirm_infobar_delegate.h"
#include "components/infobars/core/infobar.h"
-// Provides dummy definitions of static variables and functions that are
-// declared in the component but defined in the embedder in order to allow
-// components_unittests to link.
+// Provides definitions of static variables and functions that are declared in
+// the component but defined in the embedder.
// TODO(blundell): The component shouldn't be declaring statics that it's not
-// defining. crbug.com/386171
+// defining; instead, this information should be obtained via a client,
+// which can have a test implementation. crbug.com/386171
// On Android, these variables are defined in ../core/infobar_android.cc.
#if !defined(OS_ANDROID)
@@ -24,8 +24,10 @@ const int infobars::InfoBar::kMaximumArrowTargetHalfWidth = 14;
const int infobars::InfoBar::kDefaultBarTargetHeight = 36;
#endif
+// Some components' unittests exercise code that requires that
+// ConfirmInfoBarDelegate::CreateInfoBar() return a non-NULL infobar.
scoped_ptr<infobars::InfoBar> ConfirmInfoBarDelegate::CreateInfoBar(
scoped_ptr<ConfirmInfoBarDelegate> delegate) {
- NOTREACHED();
- return scoped_ptr<infobars::InfoBar>();
+ return scoped_ptr<infobars::InfoBar>(new infobars::InfoBar(
+ delegate.PassAs<infobars::InfoBarDelegate>()));
}
« no previous file with comments | « components/google/core/browser/google_url_tracker_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698