Skip to content

Commit

Permalink
DanielWagnerHall: Reflecting r13175 in IEDriver, fixing a bug with te…
Browse files Browse the repository at this point in the history
…xt getting that I'm not sure how it wasn't exposed before

r13179
  • Loading branch information
illicitonion committed Aug 2, 2011
1 parent 253cc7c commit 6a17b41
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 55 deletions.
7 changes: 4 additions & 3 deletions cpp/IEDriver/CommandHandlers/GetAlertTextCommandHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,17 @@ class GetAlertTextCommandHandler : public IECommandHandler {
}
}

std::string alert_text_value;
if (label_handle == NULL) {
response->SetErrorResponse(EUNHANDLEDERROR, "Could not find text");
alert_text_value = "";
} else {
int text_length = ::GetWindowTextLength(label_handle);
std::vector<wchar_t> text_buffer(text_length + 1);
::GetWindowText(label_handle, &text_buffer[0], text_length + 1);
std::wstring alert_text = &text_buffer[0];
std::string alert_text_value = CW2A(alert_text.c_str(), CP_UTF8);
response->SetSuccessResponse(alert_text_value);
alert_text_value = CW2A(alert_text.c_str(), CP_UTF8);
}
response->SetSuccessResponse(alert_text_value);
}
}

Expand Down
47 changes: 0 additions & 47 deletions cpp/IEDriver/CommandHandlers/SwitchToAlertCommandHandler.h

This file was deleted.

2 changes: 0 additions & 2 deletions cpp/IEDriver/IECommandExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
#include "CommandHandlers/SetAsyncScriptTimeoutCommandHandler.h"
#include "CommandHandlers/SetImplicitWaitTimeoutCommandHandler.h"
#include "CommandHandlers/SubmitElementCommandHandler.h"
#include "CommandHandlers/SwitchToAlertCommandHandler.h"
#include "CommandHandlers/SwitchToFrameCommandHandler.h"
#include "CommandHandlers/SwitchToWindowCommandHandler.h"

Expand Down Expand Up @@ -462,7 +461,6 @@ void IECommandExecutor::PopulateCommandHandlers() {
this->command_handlers_[DeleteAllCookies] = CommandHandlerHandle(new DeleteAllCookiesCommandHandler);
this->command_handlers_[Screenshot] = CommandHandlerHandle(new ScreenshotCommandHandler);

this->command_handlers_[SwitchToAlert] = CommandHandlerHandle(new SwitchToAlertCommandHandler);
this->command_handlers_[AcceptAlert] = CommandHandlerHandle(new AcceptAlertCommandHandler);
this->command_handlers_[DismissAlert] = CommandHandlerHandle(new DismissAlertCommandHandler);
this->command_handlers_[GetAlertText] = CommandHandlerHandle(new GetAlertTextCommandHandler);
Expand Down
1 change: 0 additions & 1 deletion cpp/webdriver-server/command_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ enum CommandType {
GetOrientation,
SetOrientation,

SwitchToAlert,
AcceptAlert,
DismissAlert,
GetAlertText,
Expand Down
1 change: 0 additions & 1 deletion cpp/webdriver-server/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ void Server::PopulateCommandRepository() {
this->commands_["/session/:sessionid/orientation"]["GET"] = GetOrientation;
this->commands_["/session/:sessionid/orientation"]["POST"] = SetOrientation;

this->commands_["/session/:sessionid/alert"]["GET"] = SwitchToAlert;
this->commands_["/session/:sessionid/accept_alert"]["POST"] = AcceptAlert;
this->commands_["/session/:sessionid/dismiss_alert"]["POST"] = DismissAlert;
this->commands_["/session/:sessionid/alert_text"]["GET"] = GetAlertText;
Expand Down
2 changes: 1 addition & 1 deletion java/client/test/org/openqa/selenium/SingleTestSuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class SingleTestSuite extends TestCase {
}};

public static Test suite() throws Exception {
String driver = FIREFOX_TEST;
String driver = IE;

System.setProperty("jna.library.path", "..\\build;build");
System.setProperty("webdriver.selenium.server.port", String.valueOf(findFreePort()));
Expand Down

0 comments on commit 6a17b41

Please sign in to comment.