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

Unified Diff: tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc

Issue 2569783002: When prepending "Get" to accessors, consider inheritance chain. (Closed)
Patch Set: Added test for non-virtual method scenario. Created 4 years 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: tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc
diff --git a/tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc b/tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc
index 1eff05bbbb1e633f2c32096aac2ba21eba459da1..f770362855c353fb14b5ca55373c9718ee1cc6dc 100644
--- a/tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc
+++ b/tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc
@@ -189,6 +189,39 @@ class BitVector {
MyRefPtr<FooBar> foobar_;
};
+namespace get_prefix_vs_inheritance {
+
+// Regression test for https://crbug.com/673031:
+// 1. |frame| accessor/method should be renamed in the same way for
+// WebFrameImplBase and WebLocalFrameImpl.
+// 2. Need to rename |frame| to |GetFrame| (not to |Frame|) to avoid
+// a conflict with the Frame type.
+
+class Frame {};
+class LocalFrame : public Frame {};
+
+class WebFrameImplBase {
+ public:
+ virtual Frame* GetFrame() const = 0;
+};
+
+class WebLocalFrameImpl : public WebFrameImplBase {
+ public:
+ LocalFrame* GetFrame() const override { return nullptr; }
+};
+
+// This is also a regression test for https://crbug.com/673031
+// (which can happen in a non-virtual-method case):
+class LayoutObject {};
+class LayoutBoxModelObject : public LayoutObject {};
+class PaintLayerStackingNode {
+ public:
+ // |layoutObject| should be renamed to |GetLayoutObject|.
+ LayoutBoxModelObject* GetLayoutObject() { return nullptr; }
+};
+
+} // namespace get_prefix_vs_inheritance
+
} // namespace blink
namespace WTF {

Powered by Google App Engine
This is Rietveld 408576698