|
|
Created:
9 years, 1 month ago by benrg Modified:
9 years, 1 month ago CC:
chromium-reviews, robertshield, kkania, Paweł Hajdan Jr., Emmanuel Saint-loubert-Bié Base URL:
svn://svn.chromium.org/chrome/trunk/src Visibility:
Public. |
DescriptionImplement some functions in testing_automation_provider_aura.cc
BUG=99706
TEST=none
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=110007
Patch Set 1 #
Total comments: 8
Patch Set 2 : fix all comments #
Total comments: 2
Patch Set 3 : fit nit and fix build (oops) #Messages
Total messages: 11 (0 generated)
Hi Scott, Could you please review this CL from BenRG? I do not know the automation framework that well, and therefore was not able to provide much guidance to BenRG regarding his CL or where to send it for review. Thanks, -- Emmanuel
http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testi... File chrome/browser/automation/testing_automation_provider_aura.cc (left): http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testi... chrome/browser/automation/testing_automation_provider_aura.cc:5: #include "chrome/browser/automation/testing_automation_provider.h" For .cc files you want this format for includes: include header of file you're implementing first, then newline, then remaining includes. See testing_automation_provider_win.cc for an example. http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testi... File chrome/browser/automation/testing_automation_provider_aura.cc (right): http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testi... chrome/browser/automation/testing_automation_provider_aura.cc:22: // TODO(benrg): how? This state is stored in the properties of the window unrder the key aura::kShowStateKey. http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testi... chrome/browser/automation/testing_automation_provider_aura.cc:28: // currently unimplemented in most other providers. Set *success to false here. http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testi... chrome/browser/automation/testing_automation_provider_aura.cc:71: // TODO(benrg): Windows provider uses this pointer without testing for NULL. You should NULL check.
PTAL http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testi... File chrome/browser/automation/testing_automation_provider_aura.cc (left): http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testi... chrome/browser/automation/testing_automation_provider_aura.cc:5: #include "chrome/browser/automation/testing_automation_provider.h" On 2011/11/14 17:39:24, sky wrote: > For .cc files you want this format for includes: include header of file you're > implementing first, then newline, then remaining includes. See > testing_automation_provider_win.cc for an example. Done. http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testi... File chrome/browser/automation/testing_automation_provider_aura.cc (right): http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testi... chrome/browser/automation/testing_automation_provider_aura.cc:22: // TODO(benrg): how? On 2011/11/14 17:39:24, sky wrote: > This state is stored in the properties of the window unrder the key > aura::kShowStateKey. Done. http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testi... chrome/browser/automation/testing_automation_provider_aura.cc:28: // currently unimplemented in most other providers. On 2011/11/14 17:39:24, sky wrote: > Set *success to false here. Done. http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testi... chrome/browser/automation/testing_automation_provider_aura.cc:71: // TODO(benrg): Windows provider uses this pointer without testing for NULL. On 2011/11/14 17:39:24, sky wrote: > You should NULL check. Done.
Actually since there are 2 reviewers listed, this in not for me to review: Sky can you PTAL? Thanks, -- E On Mon, Nov 14, 2011 at 12:50 PM, <benrg@chromium.org> wrote: > Reviewers: sky, Emmanuel Saint-loubert, > > Message: > PTAL > > > > http://codereview.chromium.**org/8506034/diff/1/chrome/** > browser/automation/testing_**automation_provider_aura.cc<http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testing_automation_provider_aura.cc> > File chrome/browser/automation/**testing_automation_provider_**aura.cc > (left): > > http://codereview.chromium.**org/8506034/diff/1/chrome/** > browser/automation/testing_**automation_provider_aura.cc#**oldcode5<http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testing_automation_provider_aura.cc#oldcode5> > chrome/browser/automation/**testing_automation_provider_**aura.cc:5: > #include "chrome/browser/automation/**testing_automation_provider.h" > On 2011/11/14 17:39:24, sky wrote: > >> For .cc files you want this format for includes: include header of >> > file you're > >> implementing first, then newline, then remaining includes. See >> testing_automation_provider_**win.cc for an example. >> > > Done. > > > http://codereview.chromium.**org/8506034/diff/1/chrome/** > browser/automation/testing_**automation_provider_aura.cc<http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testing_automation_provider_aura.cc> > File chrome/browser/automation/**testing_automation_provider_**aura.cc > (right): > > http://codereview.chromium.**org/8506034/diff/1/chrome/** > browser/automation/testing_**automation_provider_aura.cc#**newcode22<http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testing_automation_provider_aura.cc#newcode22> > chrome/browser/automation/**testing_automation_provider_**aura.cc:22: // > TODO(benrg): how? > On 2011/11/14 17:39:24, sky wrote: > >> This state is stored in the properties of the window unrder the key >> aura::kShowStateKey. >> > > Done. > > > http://codereview.chromium.**org/8506034/diff/1/chrome/** > browser/automation/testing_**automation_provider_aura.cc#**newcode28<http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testing_automation_provider_aura.cc#newcode28> > chrome/browser/automation/**testing_automation_provider_**aura.cc:28: // > currently unimplemented in most other providers. > On 2011/11/14 17:39:24, sky wrote: > >> Set *success to false here. >> > > Done. > > > http://codereview.chromium.**org/8506034/diff/1/chrome/** > browser/automation/testing_**automation_provider_aura.cc#**newcode71<http://codereview.chromium.org/8506034/diff/1/chrome/browser/automation/testing_automation_provider_aura.cc#newcode71> > chrome/browser/automation/**testing_automation_provider_**aura.cc:71: // > TODO(benrg): Windows provider uses this pointer without testing for > NULL. > On 2011/11/14 17:39:24, sky wrote: > >> You should NULL check. >> > > Done. > > Description: > Implement some functions in testing_automation_provider_**aura.cc > > > BUG=99706 > TEST=none > > > Please review this at http://codereview.chromium.**org/8506034/<http://codereview.chromium.org/8506... > > SVN Base: svn://svn.chromium.org/chrome/**trunk/src<http://svn.chromium.org/chrome/trunk/src> > > Affected files: > M chrome/browser/automation/**testing_automation_provider_**aura.cc > > > Index: chrome/browser/automation/**testing_automation_provider_**aura.cc > diff --git a/chrome/browser/automation/**testing_automation_provider_**aura.cc > b/chrome/browser/automation/**testing_automation_provider_**aura.cc > index 191dbbbb1da905ed855d70f08224de**5f199bd2d6..** > 88130af6dfc2b6abacdc99be1c00cb**be4fe50715 100644 > --- a/chrome/browser/automation/**testing_automation_provider_**aura.cc > +++ b/chrome/browser/automation/**testing_automation_provider_**aura.cc > @@ -5,47 +5,76 @@ > #include "chrome/browser/automation/**testing_automation_provider.h" > > #include "base/logging.h" > +#include "chrome/browser/automation/**automation_window_tracker.h" > +#include "ui/aura/window.h" > > void TestingAutomationProvider::**ActivateWindow(int handle) { > - // TODO(beng): > - NOTIMPLEMENTED(); > + if (aura::Window* window = window_tracker_->GetResource(**handle)) { > + window->Activate(); > + } else { > + // TODO(benrg): Is it correct to fail silently? The Windows provider > does. > + } > } > > void TestingAutomationProvider::**IsWindowMaximized(int handle, > bool* is_maximized, > bool* success) { > - // TODO(beng): > - NOTIMPLEMENTED(); > + if (aura::Window* window = window_tracker_->GetResource(**handle)) { > + int show_state = window->GetIntProperty(aura::**kShowStateKey); > + *is_maximized = (show_state == SHOW_STATE_MAXIMIZED); > + *success = true; > + } else { > + *success = false; > + } > } > > void TestingAutomationProvider::**TerminateSession(int handle, bool* > success) { > - // TODO(beng): > + // TODO(benrg): what should this do in aura? It's > > + // currently unimplemented in most other providers. > + *success = false; > NOTIMPLEMENTED(); > } > > void TestingAutomationProvider::**GetWindowBounds(int handle, > gfx::Rect* bounds, > bool* success) { > - // TODO(beng): > - NOTIMPLEMENTED(); > + if (const aura::Window* window = window_tracker_->GetResource(**handle)) > { > + *bounds = window->bounds(); > + *success = true; > + } else { > + *success = false; > + } > } > > void TestingAutomationProvider::**SetWindowBounds(int handle, > const gfx::Rect& bounds, > bool* success) { > - // TODO(beng): > - NOTIMPLEMENTED(); > + if (aura::Window* window = window_tracker_->GetResource(**handle)) { > + window->SetBounds(bounds); > + *success = true; > + } else { > + *success = false; > + } > } > > void TestingAutomationProvider::**SetWindowVisible(int handle, > bool visible, > bool* result) { > - // TODO(beng): > - NOTIMPLEMENTED(); > + if (aura::Window* window = window_tracker_->GetResource(**handle)) { > + if (visible) { > + window->Show(); > + } else { > + window->Hide(); > + } > + *result = true; > + } else { > + *result = false; > + } > } > > void TestingAutomationProvider::**GetWindowTitle(int handle, string16* > text) { > - // TODO(beng): > - NOTIMPLEMENTED(); > + const aura::Window* window = window_tracker_->GetResource(**handle); > + DCHECK(window); > + *text = window->title(); > } > > > >
http://codereview.chromium.org/8506034/diff/4001/chrome/browser/automation/te... File chrome/browser/automation/testing_automation_provider_aura.cc (right): http://codereview.chromium.org/8506034/diff/4001/chrome/browser/automation/te... chrome/browser/automation/testing_automation_provider_aura.cc:22: if (aura::Window* window = window_tracker_->GetResource(handle)) { nit: move assignment out of conditional (just like all the other files don't do this), here and every where else.
http://codereview.chromium.org/8506034/diff/4001/chrome/browser/automation/te... File chrome/browser/automation/testing_automation_provider_aura.cc (right): http://codereview.chromium.org/8506034/diff/4001/chrome/browser/automation/te... chrome/browser/automation/testing_automation_provider_aura.cc:22: if (aura::Window* window = window_tracker_->GetResource(handle)) { On 2011/11/14 21:25:10, sky wrote: > nit: move assignment out of conditional (just like all the other files don't do > this), here and every where else. Done.
Scott, PTAL, thanks! -- Emmanuel
LGTM
lgtm
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/benrg@chromium.org/8506034/7001
Change committed as 110007 |