| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/message_loop.h" | 5 #include "base/message_loop.h" |
| 6 #include "base/string_util.h" | 6 #include "base/string_util.h" |
| 7 #include "chrome/browser/printing/page_overlays.h" | 7 #include "chrome/browser/printing/page_overlays.h" |
| 8 #include "chrome/browser/printing/print_settings.h" | 8 #include "chrome/browser/printing/print_settings.h" |
| 9 #include "chrome/browser/printing/printed_document.h" | 9 #include "chrome/browser/printing/printed_document.h" |
| 10 #include "chrome/browser/printing/printed_page.h" | 10 #include "chrome/browser/printing/printed_page.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 printing::PageOverlays::kTime, L"", | 28 printing::PageOverlays::kTime, L"", |
| 29 printing::PageOverlays::kDate, L"", | 29 printing::PageOverlays::kDate, L"", |
| 30 printing::PageOverlays::kPage, L"1", | 30 printing::PageOverlays::kPage, L"1", |
| 31 printing::PageOverlays::kPageCount, L"2", | 31 printing::PageOverlays::kPageCount, L"2", |
| 32 printing::PageOverlays::kPageOnTotal, L"1/2", | 32 printing::PageOverlays::kPageOnTotal, L"1/2", |
| 33 printing::PageOverlays::kUrl, L"http://www.perdu.com/", | 33 printing::PageOverlays::kUrl, L"http://www.perdu.com/", |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 class PagesSource : public printing::PrintedPagesSource { | 36 class PagesSource : public printing::PrintedPagesSource { |
| 37 public: | 37 public: |
| 38 virtual void RenderOnePrintedPage(printing::PrintedDocument* document, | |
| 39 int page_number) { | |
| 40 EXPECT_FALSE(true); | |
| 41 } | |
| 42 | |
| 43 virtual std::wstring RenderSourceName() { | 38 virtual std::wstring RenderSourceName() { |
| 44 return L"Foobar Document"; | 39 return L"Foobar Document"; |
| 45 } | 40 } |
| 46 | 41 |
| 47 virtual GURL RenderSourceUrl() { | 42 virtual GURL RenderSourceUrl() { |
| 48 return GURL(L"http://www.perdu.com"); | 43 return GURL(L"http://www.perdu.com"); |
| 49 } | 44 } |
| 50 }; | 45 }; |
| 51 | 46 |
| 52 } // namespace | 47 } // namespace |
| (...skipping 20 matching lines...) Expand all Loading... |
| 73 out = printing::PageOverlays::ReplaceVariables(input, *doc.get(), | 68 out = printing::PageOverlays::ReplaceVariables(input, *doc.get(), |
| 74 *page.get()); | 69 *page.get()); |
| 75 EXPECT_FALSE(out.empty()); | 70 EXPECT_FALSE(out.empty()); |
| 76 if (wcslen(kOverlayKeys[i].expected) == 0) | 71 if (wcslen(kOverlayKeys[i].expected) == 0) |
| 77 continue; | 72 continue; |
| 78 EXPECT_EQ(StringPrintf(L"foo%lsbar", kOverlayKeys[i].expected), out) << | 73 EXPECT_EQ(StringPrintf(L"foo%lsbar", kOverlayKeys[i].expected), out) << |
| 79 kOverlayKeys[i].key; | 74 kOverlayKeys[i].key; |
| 80 } | 75 } |
| 81 } | 76 } |
| 82 | 77 |
| OLD | NEW |