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

Unified Diff: ios/chrome/browser/ui/history/tab_history_popup_controller_egtest.mm

Issue 2693013005: Updated tab history classes to use NavigationItemLists. (Closed)
Patch Set: update DEPS, include url_formatter in BUILD.gn Created 3 years, 10 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
Index: ios/chrome/browser/ui/history/tab_history_popup_controller_egtest.mm
diff --git a/ios/chrome/browser/ui/history/tab_history_popup_controller_egtest.mm b/ios/chrome/browser/ui/history/tab_history_popup_controller_egtest.mm
index 1881fe8047aca2f67d18d3facb96dd8bf9bd924e..3ef29abaf01e962b7c67fcdaccb3837b7efcbdbf 100644
--- a/ios/chrome/browser/ui/history/tab_history_popup_controller_egtest.mm
+++ b/ios/chrome/browser/ui/history/tab_history_popup_controller_egtest.mm
@@ -6,6 +6,7 @@
#include "base/strings/sys_string_conversions.h"
#include "components/strings/grit/components_strings.h"
+#include "components/url_formatter/url_formatter.h"
#import "ios/chrome/test/earl_grey/chrome_earl_grey.h"
#import "ios/chrome/test/earl_grey/chrome_matchers.h"
#import "ios/chrome/test/earl_grey/chrome_test_case.h"
@@ -16,6 +17,13 @@
#error "This file requires ARC support."
#endif
+namespace {
+// Formats |url| for display and returns an NSString representation.
+NSString* GetFormattedURLString(const GURL& url) {
+ return base::SysUTF16ToNSString(url_formatter::FormatUrl(url));
+}
+}
+
// Tests for tab history popup.
@interface TabHistoryPopupControllerTestCase : ChromeTestCase
@end
@@ -31,10 +39,10 @@ - (void)testTabHistoryMenu {
const GURL URL3 = web::test::HttpServer::MakeUrl("http://page3");
const GURL URL4 = web::test::HttpServer::MakeUrl("http://page4");
NSString* entry0 = @"New Tab";
- NSString* entry1 = base::SysUTF8ToNSString(URL1.spec());
- NSString* entry2 = base::SysUTF8ToNSString(URL2.spec());
- NSString* entry3 = base::SysUTF8ToNSString(URL3.spec());
- NSString* entry4 = base::SysUTF8ToNSString(URL4.spec());
+ NSString* entry1 = GetFormattedURLString(URL1);
+ NSString* entry2 = GetFormattedURLString(URL2);
+ NSString* entry3 = GetFormattedURLString(URL3);
+ NSString* entry4 = GetFormattedURLString(URL4);
// Create map of canned responses and set up the test HTML server.
std::map<GURL, std::string> responses;

Powered by Google App Engine
This is Rietveld 408576698