OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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) 2013 The Chromium Authors. All rights reserved. | 10 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // base::MessageLoop* loop = base::MessageLoop::current(); | 59 // base::MessageLoop* loop = base::MessageLoop::current(); |
60 // loop->PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(), | 60 // loop->PostDelayedTask(FROM_HERE, base::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), base::StartsWith("flower")) |
70 // .Times(1) | 70 // .Times(1) |
71 // .WillOnce(Invoke(CreateFunctor(&mock, &Mock::HandleFlowers, | 71 // .WillOnce(Invoke(CreateFunctor(&mock, &Mock::HandleFlowers, |
72 // string("orchids")))); | 72 // string("orchids")))); |
73 // | 73 // |
74 // | 74 // |
75 // // No pre-bound arguments, two call-time arguments passed | 75 // // No pre-bound arguments, two call-time arguments passed |
76 // // directly to DoLogMessage | 76 // // directly to DoLogMessage |
77 // EXPECT_CALL(mock, OnLogMessage(_, _)) | 77 // EXPECT_CALL(mock, OnLogMessage(_, _)) |
78 // .Times(AnyNumber()) | 78 // .Times(AnyNumber()) |
79 // .WillAlways(Invoke(CreateFunctor, &mock, &Mock::DoLogMessage)); | 79 // .WillAlways(Invoke(CreateFunctor, &mock, &Mock::DoLogMessage)); |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 print MUTANT | 441 print MUTANT |
442 for prebound in xrange(0, 6 + 1): | 442 for prebound in xrange(0, 6 + 1): |
443 for args in xrange(0, 6 + 1): | 443 for args in xrange(0, 6 + 1): |
444 GenerateCreateFunctor(prebound, args) | 444 GenerateCreateFunctor(prebound, args) |
445 print FOOTER | 445 print FOOTER |
446 return 0 | 446 return 0 |
447 | 447 |
448 | 448 |
449 if __name__ == "__main__": | 449 if __name__ == "__main__": |
450 sys.exit(main()) | 450 sys.exit(main()) |
OLD | NEW |