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

Unified Diff: printing/page_overlays_unittest.cc

Issue 193086: Fix printing project on linux. (Closed)
Patch Set: fix git error Created 11 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 | « printing/page_overlays.cc ('k') | printing/pdf_ps_metafile_linux_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/page_overlays_unittest.cc
diff --git a/printing/page_overlays_unittest.cc b/printing/page_overlays_unittest.cc
index ccdc15a63729a180e354bf78388882ae572d01ec..266407aa69e07ca4fe29e01a3e7e430b3826ef46 100644
--- a/printing/page_overlays_unittest.cc
+++ b/printing/page_overlays_unittest.cc
@@ -13,24 +13,19 @@
namespace {
-class PageOverlaysTest : public testing::Test {
- private:
- MessageLoop message_loop_;
-};
-
struct Keys {
const wchar_t* key;
const wchar_t* expected;
};
const Keys kOverlayKeys[] = {
- printing::PageOverlays::kTitle, L"Foobar Document",
- printing::PageOverlays::kTime, L"",
- printing::PageOverlays::kDate, L"",
- printing::PageOverlays::kPage, L"1",
- printing::PageOverlays::kPageCount, L"2",
- printing::PageOverlays::kPageOnTotal, L"1/2",
- printing::PageOverlays::kUrl, L"http://www.perdu.com/",
+ { printing::PageOverlays::kTitle, L"Foobar Document" },
+ { printing::PageOverlays::kTime, L"" },
+ { printing::PageOverlays::kDate, L"" },
+ { printing::PageOverlays::kPage, L"1" },
+ { printing::PageOverlays::kPageCount, L"2" },
+ { printing::PageOverlays::kPageOnTotal, L"1/2" },
+ { printing::PageOverlays::kUrl, L"http://www.perdu.com/" },
};
class PagesSource : public printing::PrintedPagesSource {
@@ -40,12 +35,16 @@ class PagesSource : public printing::PrintedPagesSource {
}
virtual GURL RenderSourceUrl() {
- return GURL(L"http://www.perdu.com");
+ return GURL("http://www.perdu.com");
}
};
} // namespace
+class PageOverlaysTest : public testing::Test {
+private:
+ MessageLoop message_loop_;
+};
TEST_F(PageOverlaysTest, StringConversion) {
printing::PageOverlays overlays;
@@ -63,21 +62,21 @@ TEST_F(PageOverlaysTest, StringConversion) {
std::wstring input;
std::wstring out;
- for (int i = 0; i < arraysize(kOverlayKeys); ++i) {
+ for (size_t i = 0; i < arraysize(kOverlayKeys); ++i) {
input = StringPrintf(L"foo%lsbar", kOverlayKeys[i].key);
out = printing::PageOverlays::ReplaceVariables(input, *doc.get(),
*page.get());
EXPECT_FALSE(out.empty());
if (wcslen(kOverlayKeys[i].expected) == 0)
continue;
- EXPECT_EQ(StringPrintf(L"foo%lsbar", kOverlayKeys[i].expected), out) <<
- kOverlayKeys[i].key;
+ std::wstring expected = StringPrintf(L"foo%lsbar", kOverlayKeys[i].expected);
+ EXPECT_EQ(expected, out) << kOverlayKeys[i].key;
}
// Check if SetOverlay really sets the page overlay.
overlays.SetOverlay(printing::PageOverlays::LEFT,
printing::PageOverlays::TOP,
- UTF16ToWide(L"Page {page}"));
+ L"Page {page}");
input = overlays.GetOverlay(printing::PageOverlays::LEFT,
printing::PageOverlays::TOP);
EXPECT_EQ(input, L"Page {page}");
« no previous file with comments | « printing/page_overlays.cc ('k') | printing/pdf_ps_metafile_linux_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698