OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 package org.chromium.distiller; | 5 package org.chromium.distiller; |
6 | 6 |
7 import com.google.gwt.dom.client.Document; | 7 import com.google.gwt.dom.client.Document; |
8 import com.google.gwt.dom.client.Element; | 8 import com.google.gwt.dom.client.Element; |
9 import com.google.gwt.dom.client.ImageElement; | 9 import com.google.gwt.dom.client.ImageElement; |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 div.addClassName("dateline"); | 27 div.addClassName("dateline"); |
28 div.setInnerHTML(expectedDate); | 28 div.setInnerHTML(expectedDate); |
29 mRoot.appendChild(div); | 29 mRoot.appendChild(div); |
30 | 30 |
31 IEReadingViewParser parser = new IEReadingViewParser(mRoot); | 31 IEReadingViewParser parser = new IEReadingViewParser(mRoot); |
32 assertEquals(expectedDate, parser.getArticle().publishedTime); | 32 assertEquals(expectedDate, parser.getArticle().publishedTime); |
33 } | 33 } |
34 | 34 |
35 public void testDateInSubstringClassName() { | 35 public void testDateInSubstringClassName() { |
36 Element div = TestUtil.createDiv(0); | 36 Element div = TestUtil.createDiv(0); |
37 String expectedDate = "Monday January 1st 2011 01:01"; | |
38 div.addClassName("b4datelineaft"); | 37 div.addClassName("b4datelineaft"); |
39 div.setInnerHTML("Monday January 1st 2011 01:01"); | 38 div.setInnerHTML("Monday January 1st 2011 01:01"); |
40 mRoot.appendChild(div); | 39 mRoot.appendChild(div); |
41 | 40 |
42 IEReadingViewParser parser = new IEReadingViewParser(mRoot); | 41 IEReadingViewParser parser = new IEReadingViewParser(mRoot); |
43 assertEquals("", parser.getArticle().publishedTime); | 42 assertEquals("", parser.getArticle().publishedTime); |
44 } | 43 } |
45 | 44 |
46 public void testDateInOneElemWithMultiClasses() { | 45 public void testDateInOneElemWithMultiClasses() { |
47 String expectedDate = "Tuesday February 2nd 2012 02:02"; | 46 String expectedDate = "Tuesday February 2nd 2012 02:02"; |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 Element figure = createFigureWithCaption("Default Dominant Image"); | 391 Element figure = createFigureWithCaption("Default Dominant Image"); |
393 ImageElement image = TestUtil.createImage(); | 392 ImageElement image = TestUtil.createImage(); |
394 image.setSrc("http://example.com/dominant.jpeg"); | 393 image.setSrc("http://example.com/dominant.jpeg"); |
395 image.setWidth(600); | 394 image.setWidth(600); |
396 image.setHeight(400); | 395 image.setHeight(400); |
397 | 396 |
398 figure.appendChild(image); | 397 figure.appendChild(image); |
399 return figure; | 398 return figure; |
400 } | 399 } |
401 } | 400 } |
OLD | NEW |