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

Side by Side Diff: content/shell/renderer/layout_test/leak_detector.h

Issue 1715203002: Stop async spellchecker before running the leak detector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + parameterize WebLeakDetector over WebFrames instead Created 4 years, 10 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
OLDNEW
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 #ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_LEAK_DETECTOR_H_ 5 #ifndef CONTENT_SHELL_RENDERER_LAYOUT_TEST_LEAK_DETECTOR_H_
6 #define CONTENT_SHELL_RENDERER_LAYOUT_TEST_LEAK_DETECTOR_H_ 6 #define CONTENT_SHELL_RENDERER_LAYOUT_TEST_LEAK_DETECTOR_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
9 #include "content/shell/common/leak_detection_result.h" 10 #include "content/shell/common/leak_detection_result.h"
10 #include "third_party/WebKit/public/web/WebLeakDetector.h" 11 #include "third_party/WebKit/public/web/WebLeakDetector.h"
11 12
12 namespace blink { 13 namespace blink {
13 class WebLocalFrame; 14 class WebFrame;
14 } // namespace blink 15 } // namespace blink
15 16
16 namespace content { 17 namespace content {
17 18
18 class BlinkTestRunner; 19 class BlinkTestRunner;
19 20
20 // LeakDetector counts DOM objects and compare them between two pages. 21 // LeakDetector counts DOM objects and compare them between two pages.
21 class LeakDetector : public blink::WebLeakDetectorClient { 22 class LeakDetector : public blink::WebLeakDetectorClient {
22 public: 23 public:
23 explicit LeakDetector(BlinkTestRunner* test_runner); 24 explicit LeakDetector(BlinkTestRunner* test_runner);
24 virtual ~LeakDetector(); 25 virtual ~LeakDetector();
25 26
26 // Counts DOM objects, compare the previous status and returns the result of 27 // Counts DOM objects, compare the previous status and returns the result of
27 // leak detection. It is assumed that this method is always called when a 28 // leak detection. It is assumed that this method is always called when a
28 // specific page, like about:blank is loaded to compare the previous 29 // specific page, like about:blank is loaded to compare the previous
29 // circumstance of DOM objects. If the number of objects increses, there 30 // circumstance of DOM objects. If the number of objects increses, there
30 // should be a leak. 31 // should be a leak.
31 void TryLeakDetection(blink::WebLocalFrame* frame); 32 void TryLeakDetection(blink::WebFrame* frame);
32 33
33 // WebLeakDetectorClient: 34 // WebLeakDetectorClient:
34 void onLeakDetectionComplete(const Result& result) override; 35 void onLeakDetectionComplete(const Result& result) override;
35 36
36 private: 37 private:
37 BlinkTestRunner* test_runner_; 38 BlinkTestRunner* test_runner_;
38 scoped_ptr<blink::WebLeakDetector> web_leak_detector_; 39 scoped_ptr<blink::WebLeakDetector> web_leak_detector_;
39 blink::WebLeakDetectorClient::Result previous_result_; 40 blink::WebLeakDetectorClient::Result previous_result_;
40 41
41 DISALLOW_COPY_AND_ASSIGN(LeakDetector); 42 DISALLOW_COPY_AND_ASSIGN(LeakDetector);
42 }; 43 };
43 44
44 } // namespace content 45 } // namespace content
45 46
46 #endif // CONTENT_SHELL_RENDERER_LAYOUT_TEST_LEAK_DETECTOR_H_ 47 #endif // CONTENT_SHELL_RENDERER_LAYOUT_TEST_LEAK_DETECTOR_H_
OLDNEW
« no previous file with comments | « content/shell/renderer/layout_test/blink_test_runner.cc ('k') | content/shell/renderer/layout_test/leak_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698