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

Side by Side Diff: Source/web/tests/PopupMenuTest.cpp

Issue 142703003: Make PopupMenuTest run on all platforms. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/platform/fonts/FontFallbackList.cpp ('k') | Source/web/web.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 str.append(String::number(listIndex)); 93 str.append(String::number(listIndex));
94 return str; 94 return str;
95 } 95 }
96 virtual String itemLabel(unsigned) const { return String(); } 96 virtual String itemLabel(unsigned) const { return String(); }
97 virtual String itemIcon(unsigned) const { return String(); } 97 virtual String itemIcon(unsigned) const { return String(); }
98 virtual String itemToolTip(unsigned listIndex) const { return itemText(listI ndex); } 98 virtual String itemToolTip(unsigned listIndex) const { return itemText(listI ndex); }
99 virtual String itemAccessibilityText(unsigned listIndex) const { return item Text(listIndex); } 99 virtual String itemAccessibilityText(unsigned listIndex) const { return item Text(listIndex); }
100 virtual bool itemIsEnabled(unsigned listIndex) const { return m_disabledInde xSet.find(listIndex) == m_disabledIndexSet.end(); } 100 virtual bool itemIsEnabled(unsigned listIndex) const { return m_disabledInde xSet.find(listIndex) == m_disabledIndexSet.end(); }
101 virtual PopupMenuStyle itemStyle(unsigned listIndex) const 101 virtual PopupMenuStyle itemStyle(unsigned listIndex) const
102 { 102 {
103 Font font(FontPlatformData(12.0, false, false), false); 103 FontDescription fontDescription;
104 fontDescription.setComputedSize(12.0);
105 Font font(fontDescription, 0, 0);
106 font.update(0);
104 return PopupMenuStyle(Color::black, Color::white, font, true, false, Len gth(), TextDirection(), false /* has text direction override */); 107 return PopupMenuStyle(Color::black, Color::white, font, true, false, Len gth(), TextDirection(), false /* has text direction override */);
105 } 108 }
106 virtual PopupMenuStyle menuStyle() const { return itemStyle(0); } 109 virtual PopupMenuStyle menuStyle() const { return itemStyle(0); }
107 virtual int clientInsetLeft() const { return 0; } 110 virtual int clientInsetLeft() const { return 0; }
108 virtual int clientInsetRight() const { return 0; } 111 virtual int clientInsetRight() const { return 0; }
109 virtual LayoutUnit clientPaddingLeft() const { return 0; } 112 virtual LayoutUnit clientPaddingLeft() const { return 0; }
110 virtual LayoutUnit clientPaddingRight() const { return 0; } 113 virtual LayoutUnit clientPaddingRight() const { return 0; }
111 virtual int listSize() const { return 10; } 114 virtual int listSize() const { return 10; }
112 virtual int selectedIndex() const { return m_selectIndex; } 115 virtual int selectedIndex() const { return m_selectIndex; }
113 virtual void popupDidHide() { } 116 virtual void popupDidHide() { }
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 // menuItemHeight * 1.5 means the Y position on the item at index 1. 505 // menuItemHeight * 1.5 means the Y position on the item at index 1.
503 IntPoint row1Point(2, menuItemHeight * 1.5); 506 IntPoint row1Point(2, menuItemHeight * 1.5);
504 simulateLeftMouseDownEvent(row1Point); 507 simulateLeftMouseDownEvent(row1Point);
505 simulateLeftMouseUpEvent(row1Point); 508 simulateLeftMouseUpEvent(row1Point);
506 509
507 WebElement element = webView()->mainFrame()->document().getElementById("mess age"); 510 WebElement element = webView()->mainFrame()->document().getElementById("mess age");
508 EXPECT_STREQ("click", element.innerText().utf8().data()); 511 EXPECT_STREQ("click", element.innerText().utf8().data());
509 } 512 }
510 513
511 } // namespace 514 } // namespace
OLDNEW
« no previous file with comments | « Source/platform/fonts/FontFallbackList.cpp ('k') | Source/web/web.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698