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

Side by Side Diff: chrome/test/chromedriver/navigation_tracker.cc

Issue 12093057: [ChromeDriver] Send DOM.getDocument after each DOM.documentUpdated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix compile error on win_rel Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/chromedriver/navigation_tracker.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #include "chrome/test/chromedriver/navigation_tracker.h" 5 #include "chrome/test/chromedriver/navigation_tracker.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 10
11 NavigationTracker::NavigationTracker() {} 11 NavigationTracker::NavigationTracker() {}
12 12
13 NavigationTracker::~NavigationTracker() {} 13 NavigationTracker::~NavigationTracker() {}
14 14
15 Status NavigationTracker::Init(DevToolsClient* client) {
16 // Enable page domain notifications to allow tracking navigation state.
17 base::DictionaryValue params;
18 DCHECK(client);
19 return client->SendCommand("Page.enable", params);
20 }
21
15 bool NavigationTracker::IsPendingNavigation(const std::string& frame_id) { 22 bool NavigationTracker::IsPendingNavigation(const std::string& frame_id) {
16 return frame_state_[frame_id].IsPendingNavigation(); 23 return frame_state_[frame_id].IsPendingNavigation();
17 } 24 }
18 25
19 void NavigationTracker::OnEvent(const std::string& method, 26 void NavigationTracker::OnEvent(const std::string& method,
20 const base::DictionaryValue& params) { 27 const base::DictionaryValue& params) {
21 if (method == "Page.frameStartedLoading" || 28 if (method == "Page.frameStartedLoading" ||
22 method == "Page.frameStoppedLoading" || 29 method == "Page.frameStoppedLoading" ||
23 method == "Page.frameScheduledNavigation" || 30 method == "Page.frameScheduledNavigation" ||
24 method == "Page.frameClearedScheduledNavigation") { 31 method == "Page.frameClearedScheduledNavigation") {
(...skipping 22 matching lines...) Expand all
47 return (state_bitfield_ & (LOADING | SCHEDULED)) != 0; 54 return (state_bitfield_ & (LOADING | SCHEDULED)) != 0;
48 } 55 }
49 56
50 void NavigationTracker::NavigationState::SetFlags(const Mask mask) { 57 void NavigationTracker::NavigationState::SetFlags(const Mask mask) {
51 state_bitfield_ |= mask; 58 state_bitfield_ |= mask;
52 } 59 }
53 60
54 void NavigationTracker::NavigationState::ClearFlags(const Mask mask) { 61 void NavigationTracker::NavigationState::ClearFlags(const Mask mask) {
55 state_bitfield_ &= ~mask; 62 state_bitfield_ &= ~mask;
56 } 63 }
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/navigation_tracker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698