diff options
Diffstat (limited to 'webkit/tools/test_shell/test_shell_devtools_callargs.h')
-rw-r--r-- | webkit/tools/test_shell/test_shell_devtools_callargs.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/test_shell_devtools_callargs.h b/webkit/tools/test_shell/test_shell_devtools_callargs.h new file mode 100644 index 0000000..3fd7632 --- /dev/null +++ b/webkit/tools/test_shell/test_shell_devtools_callargs.h @@ -0,0 +1,43 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef TEST_SHELL_DEVTOOLS_CALLARGS_H_ +#define TEST_SHELL_DEVTOOLS_CALLARGS_H_ + +#include "base/logging.h" + +#include "third_party/WebKit/WebKit/chromium/public/WebDevToolsMessageData.h" +#include "third_party/WebKit/WebKit/chromium/public/WebString.h" + +class TestShellDevToolsCallArgs { + public: + TestShellDevToolsCallArgs(const WebKit::WebDevToolsMessageData& data) + : data_(data) { + ++calls_count_; + + // The same behaiviour as we have in case of IPC. + for (size_t i = 0; i < data_.arguments.size(); ++i) + if (data_.arguments[i].isNull()) + data_.arguments[i] = WebKit::WebString::fromUTF8(""); + } + + TestShellDevToolsCallArgs(const TestShellDevToolsCallArgs& args) + : data_(args.data_) { + ++calls_count_; + } + + ~TestShellDevToolsCallArgs() { + --calls_count_; + DCHECK(calls_count_ >= 0); + } + + static int calls_count() { return calls_count_; } + + WebKit::WebDevToolsMessageData data_; + + private: + static int calls_count_; +}; + +#endif // TEST_SHELL_DEVTOOLS_CALLARGS_H_ |