diff options
author | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-05 10:19:57 +0000 |
---|---|---|
committer | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-05 10:19:57 +0000 |
commit | 195792b55d3c8ebd850fe22870f66f2883d68b87 (patch) | |
tree | cef501624be08418d79d3e477e97a8e1b626a102 /webkit/glue | |
parent | b39fe8d69103cab7d88bfde52084d0d84d51c3b7 (diff) | |
download | chromium_src-195792b55d3c8ebd850fe22870f66f2883d68b87.zip chromium_src-195792b55d3c8ebd850fe22870f66f2883d68b87.tar.gz chromium_src-195792b55d3c8ebd850fe22870f66f2883d68b87.tar.bz2 |
DevTools: Bugfixes for the round of sanity testing.
Review URL: http://codereview.chromium.org/109010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15291 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/devtools/debugger_agent_impl.cc | 2 | ||||
-rw-r--r-- | webkit/glue/devtools/debugger_agent_impl.h | 8 | ||||
-rw-r--r-- | webkit/glue/devtools/dom_agent_impl.cc | 7 | ||||
-rw-r--r-- | webkit/glue/devtools/dom_agent_unittest.cc | 22 | ||||
-rw-r--r-- | webkit/glue/webdevtoolsagent_impl.cc | 1 | ||||
-rw-r--r-- | webkit/glue/webdevtoolsagent_impl.h | 2 |
6 files changed, 34 insertions, 8 deletions
diff --git a/webkit/glue/devtools/debugger_agent_impl.cc b/webkit/glue/devtools/debugger_agent_impl.cc index ac69664..845bd6e 100644 --- a/webkit/glue/devtools/debugger_agent_impl.cc +++ b/webkit/glue/devtools/debugger_agent_impl.cc @@ -61,11 +61,13 @@ void DebuggerAgentImpl::DebuggerOutput(const std::string& command) { webdevtools_agent_->ForceRepaint(); } +// static void DebuggerAgentImpl::ResetUtilityContext( Document* document, v8::Persistent<v8::Context>* context) { if (!context->IsEmpty()) { context->Dispose(); + context->Clear(); } if (!document) { return; diff --git a/webkit/glue/devtools/debugger_agent_impl.h b/webkit/glue/devtools/debugger_agent_impl.h index bfd3e96..0425dfe 100644 --- a/webkit/glue/devtools/debugger_agent_impl.h +++ b/webkit/glue/devtools/debugger_agent_impl.h @@ -23,15 +23,15 @@ class String; class DebuggerAgentImpl : public DebuggerAgent { public: + // Creates utility context with injected js agent. + static void ResetUtilityContext(WebCore::Document* document, + v8::Persistent<v8::Context>* context); + DebuggerAgentImpl(WebViewImpl* web_view_impl, DebuggerAgentDelegate* delegate, WebDevToolsAgentImpl* webdevtools_agent); virtual ~DebuggerAgentImpl(); - // Creates utility context with injected js agent. - void ResetUtilityContext(WebCore::Document* document, - v8::Persistent<v8::Context>* context); - // DebuggerAgent implementation. virtual void DebugBreak(); diff --git a/webkit/glue/devtools/dom_agent_impl.cc b/webkit/glue/devtools/dom_agent_impl.cc index 88c42dd..d8d6ea5 100644 --- a/webkit/glue/devtools/dom_agent_impl.cc +++ b/webkit/glue/devtools/dom_agent_impl.cc @@ -293,11 +293,10 @@ int DomAgentImpl::PushNodePathToClient(Node* node_to_select) { // element is known to the client ASSERT(element); path.append(element); - for (int i = path.size() - 1; i >= 0; --i) { - element = path.at(i); - OwnPtr<Value> children(BuildValueForElementChildren(element, 1)); - delegate_->SetChildNodes(GetIdForNode(element), *children.get()); + int node_id = GetIdForNode(path.at(i)); + ASSERT(node_id); + PushChildNodesToClient(node_id); } return GetIdForNode(node_to_select); } diff --git a/webkit/glue/devtools/dom_agent_unittest.cc b/webkit/glue/devtools/dom_agent_unittest.cc index c95111e..2b69499 100644 --- a/webkit/glue/devtools/dom_agent_unittest.cc +++ b/webkit/glue/devtools/dom_agent_unittest.cc @@ -164,6 +164,7 @@ TEST_F(DomAgentTests, ChildNodeInsertedKnownChildren) { mock_delegate_->ChildNodeInserted(kBodyElemId, 0, *v.get()); mock_delegate_->Replay(); + // Blank text should be transparent. RefPtr<Text> text = document_->createTextNode(" "); body_->appendChild(text, ec_); @@ -172,6 +173,27 @@ TEST_F(DomAgentTests, ChildNodeInsertedKnownChildren) { mock_delegate_->Verify(); } +// Tests that "child node inserted" event is being fired after push path to +// node request. +TEST_F(DomAgentTests, ChildNodeInsertedAfterPushPathToNode) { + RefPtr<Element> div = document_->createElement("DIV", ec_); + body_->appendChild(div, ec_); + + dom_agent_->GetDocumentElement(); + dom_agent_->PushNodePathToClient(div.get()); + mock_delegate_->Reset(); + + // Since children were already requested via path to node, event should have + // all the new child data. + OwnPtr<Value> v(DevToolsRpc::ParseMessage("[4,1,\"DIV\",\"\",[],0]")); + mock_delegate_->ChildNodeInserted(kBodyElemId, 3, *v.get()); + mock_delegate_->Replay(); + + RefPtr<Element> div2 = document_->createElement("DIV", ec_); + body_->appendChild(div2, ec_); + mock_delegate_->Verify(); +} + // Tests that "child node inserted" event is being fired. TEST_F(DomAgentTests, ChildNodePrepend) { RefPtr<Element> div = document_->createElement("DIV", ec_); diff --git a/webkit/glue/webdevtoolsagent_impl.cc b/webkit/glue/webdevtoolsagent_impl.cc index a4c1745..05998eb 100644 --- a/webkit/glue/webdevtoolsagent_impl.cc +++ b/webkit/glue/webdevtoolsagent_impl.cc @@ -59,6 +59,7 @@ WebDevToolsAgentImpl::WebDevToolsAgentImpl( WebDevToolsAgentImpl::~WebDevToolsAgentImpl() { if (!utility_context_.IsEmpty()) { utility_context_.Dispose(); + utility_context_.Clear(); } } diff --git a/webkit/glue/webdevtoolsagent_impl.h b/webkit/glue/webdevtoolsagent_impl.h index b6ade47..c8c1f6b 100644 --- a/webkit/glue/webdevtoolsagent_impl.h +++ b/webkit/glue/webdevtoolsagent_impl.h @@ -111,6 +111,8 @@ class WebDevToolsAgentImpl OwnPtr<NetAgentImpl> net_agent_impl_; Vector<ConsoleMessage> console_log_; bool attached_; + // TODO(pfeldman): This should not be needed once GC styles issue is fixed + // for matching rules. v8::Persistent<v8::Context> utility_context_; DISALLOW_COPY_AND_ASSIGN(WebDevToolsAgentImpl); }; |