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

Unified Diff: tools/clang/rewrite_to_chrome_style/tests/methods-original.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
« no previous file with comments | « tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/rewrite_to_chrome_style/tests/methods-original.cc
diff --git a/tools/clang/rewrite_to_chrome_style/tests/methods-original.cc b/tools/clang/rewrite_to_chrome_style/tests/methods-original.cc
index 1f8f3a002e870b080c8b0d3ecd434045adb1ac8f..28020337bb25359f3d6a8622660954de551b975d 100644
--- a/tools/clang/rewrite_to_chrome_style/tests/methods-original.cc
+++ b/tools/clang/rewrite_to_chrome_style/tests/methods-original.cc
@@ -193,6 +193,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* frame() const = 0;
+};
+
+class WebLocalFrameImpl : public WebFrameImplBase {
+ public:
+ LocalFrame* frame() 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* layoutObject() { return nullptr; }
+};
+
+} // namespace get_prefix_vs_inheritance
+
} // namespace blink
namespace WTF {
« no previous file with comments | « tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698