You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.6 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #include "talk/base/gunit.h"
  2. #include "talk/base/window.h"
  3. #include "talk/base/windowpicker.h"
  4. #include "talk/base/windowpickerfactory.h"
  5. #ifdef OSX
  6. # define DISABLE_ON_MAC(name) DISABLED_ ## name
  7. #else
  8. # define DISABLE_ON_MAC(name) name
  9. #endif
  10. TEST(WindowPickerTest, GetWindowList) {
  11. if (!talk_base::WindowPickerFactory::IsSupported()) {
  12. LOG(LS_INFO) << "skipping test: window capturing is not supported with "
  13. << "current configuration.";
  14. }
  15. talk_base::scoped_ptr<talk_base::WindowPicker> picker(
  16. talk_base::WindowPickerFactory::CreateWindowPicker());
  17. EXPECT_TRUE(picker->Init());
  18. talk_base::WindowDescriptionList descriptions;
  19. EXPECT_TRUE(picker->GetWindowList(&descriptions));
  20. }
  21. // TODO(hughv) Investigate why this fails on pulse but not locally after
  22. // upgrading to XCode 4.5. The failure is GetDesktopList returning FALSE.
  23. TEST(WindowPickerTest, DISABLE_ON_MAC(GetDesktopList)) {
  24. if (!talk_base::WindowPickerFactory::IsSupported()) {
  25. LOG(LS_INFO) << "skipping test: window capturing is not supported with "
  26. << "current configuration.";
  27. }
  28. talk_base::scoped_ptr<talk_base::WindowPicker> picker(
  29. talk_base::WindowPickerFactory::CreateWindowPicker());
  30. EXPECT_TRUE(picker->Init());
  31. talk_base::DesktopDescriptionList descriptions;
  32. EXPECT_TRUE(picker->GetDesktopList(&descriptions));
  33. if (descriptions.size() > 0) {
  34. int width = 0;
  35. int height = 0;
  36. EXPECT_TRUE(picker->GetDesktopDimensions(descriptions[0].id(), &width,
  37. &height));
  38. EXPECT_GT(width, 0);
  39. EXPECT_GT(height, 0);
  40. }
  41. }