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

Side by Side Diff: testing/generate_gmock_mutant.py

Issue 8879028: Remove MessageLoop::QuitTask() from testing/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | testing/gmock_mutant.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import string 6 import string
7 import sys 7 import sys
8 8
9 HEADER = """\ 9 HEADER = """\
10 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 10 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
11 // Use of this source code is governed by a BSD-style license that can be 11 // Use of this source code is governed by a BSD-style license that can be
12 // found in the LICENSE file. 12 // found in the LICENSE file.
13 13
14 // This file automatically generated by testing/generate_gmock_mutant.py. 14 // This file automatically generated by testing/generate_gmock_mutant.py.
15 // DO NOT EDIT. 15 // DO NOT EDIT.
16 16
17 #ifndef TESTING_GMOCK_MUTANT_H_ 17 #ifndef TESTING_GMOCK_MUTANT_H_
18 #define TESTING_GMOCK_MUTANT_H_ 18 #define TESTING_GMOCK_MUTANT_H_
19 19
20 // The intention of this file is to make possible using GMock actions in 20 // The intention of this file is to make possible using GMock actions in
(...skipping 29 matching lines...) Expand all
50 // string result = SStringPrintf("In request of %d %s ", n, request); 50 // string result = SStringPrintf("In request of %d %s ", n, request);
51 // for (int i = 0; i < n; ++i) result.append(reply) 51 // for (int i = 0; i < n; ++i) result.append(reply)
52 // return result; 52 // return result;
53 // } 53 // }
54 // 54 //
55 // void DoLogMessage(int level, const string& message) { 55 // void DoLogMessage(int level, const string& message) {
56 // } 56 // }
57 // 57 //
58 // void QuitMessageLoop(int seconds) { 58 // void QuitMessageLoop(int seconds) {
59 // MessageLoop* loop = MessageLoop::current(); 59 // MessageLoop* loop = MessageLoop::current();
60 // loop->PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask, 60 // loop->PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(),
61 // 1000 * seconds); 61 // 1000 * seconds);
62 // } 62 // }
63 // }; 63 // };
64 // 64 //
65 // Mock mock; 65 // Mock mock;
66 // // Will invoke mock.HandleFlowers("orchids", n, request) 66 // // Will invoke mock.HandleFlowers("orchids", n, request)
67 // // "orchids" is a pre-bound argument, and <n> and <request> are call-time 67 // // "orchids" is a pre-bound argument, and <n> and <request> are call-time
68 // // arguments - they are not known until the OnRequest mock is invoked. 68 // // arguments - they are not known until the OnRequest mock is invoked.
69 // EXPECT_CALL(mock, OnRequest(Ge(5), StartsWith("flower")) 69 // EXPECT_CALL(mock, OnRequest(Ge(5), StartsWith("flower"))
70 // .Times(1) 70 // .Times(1)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 // 105 //
106 // EXPECT_CALL(mock, DemiurgeCreated(_)).Times(1) 106 // EXPECT_CALL(mock, DemiurgeCreated(_)).Times(1)
107 // .WillOnce(Invoke(CreateFunctor(&mock, &Mock::StoreDemiurge))); 107 // .WillOnce(Invoke(CreateFunctor(&mock, &Mock::StoreDemiurge)));
108 // 108 //
109 // EXPECT_CALL(mock, OnRequest(_, StrEq("Moby Dick"))) 109 // EXPECT_CALL(mock, OnRequest(_, StrEq("Moby Dick")))
110 // .Times(AnyNumber()) 110 // .Times(AnyNumber())
111 // .WillAlways(WithArgs<0>(Invoke( 111 // .WillAlways(WithArgs<0>(Invoke(
112 // CreateFunctor(&mock->demiurge_, &Demiurge::DecreaseMonsters)))); 112 // CreateFunctor(&mock->demiurge_, &Demiurge::DecreaseMonsters))));
113 // 113 //
114 114
115 #include "base/linked_ptr.h" 115 #include "base/memory/linked_ptr.h"
116 #include "base/tuple.h" // for Tuple 116 #include "base/tuple.h" // for Tuple
117 117
118 namespace testing {""" 118 namespace testing {"""
119 119
120 MUTANT = """\ 120 MUTANT = """\
121 121
122 // Interface that is exposed to the consumer, that does the actual calling 122 // Interface that is exposed to the consumer, that does the actual calling
123 // of the method. 123 // of the method.
124 template <typename R, typename Params> 124 template <typename R, typename Params>
125 class MutantRunner { 125 class MutantRunner {
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 print MUTANT 446 print MUTANT
447 for prebound in xrange(0, 6 + 1): 447 for prebound in xrange(0, 6 + 1):
448 for args in xrange(0, 6 + 1): 448 for args in xrange(0, 6 + 1):
449 GenerateCreateFunctor(prebound, args) 449 GenerateCreateFunctor(prebound, args)
450 print FOOTER 450 print FOOTER
451 return 0 451 return 0
452 452
453 453
454 if __name__ == "__main__": 454 if __name__ == "__main__":
455 sys.exit(main()) 455 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | testing/gmock_mutant.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698